From: Igor Sysoev Date: Fri, 25 Dec 2009 15:43:40 +0000 (+0000) Subject: use "localhost" in "Host" header line, if unix socket is used in "auth_http" X-Git-Tag: release-0.8.32~6 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/postgres_fdw.c?a=commitdiff_plain;h=280e5e7072b474e71b2b61e989a0f7e76abc39fa;p=nginx.git use "localhost" in "Host" header line, if unix socket is used in "auth_http" --- diff --git a/src/mail/ngx_mail_auth_http_module.c b/src/mail/ngx_mail_auth_http_module.c index c755c7221..b9f963578 100644 --- a/src/mail/ngx_mail_auth_http_module.c +++ b/src/mail/ngx_mail_auth_http_module.c @@ -1405,7 +1405,14 @@ ngx_mail_auth_http(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) ahcf->peer = u.addrs; - ahcf->host_header = u.host; + if (u.family != AF_UNIX) { + ahcf->host_header = u.host; + + } else { + ahcf->host_header.len = sizeof("localhost") - 1; + ahcf->host_header.data = (u_char *) "localhost"; + } + ahcf->uri = u.uri; if (ahcf->uri.len == 0) {