aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-12-25 15:43:40 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-12-25 15:43:40 +0000
commit280e5e7072b474e71b2b61e989a0f7e76abc39fa (patch)
tree99ac8b81dc5ac4c124c3028362b1be7524f42b4d /src
parent1651542b3ad80440378674204fba9af6e0092637 (diff)
downloadnginx-280e5e7072b474e71b2b61e989a0f7e76abc39fa.tar.gz
nginx-280e5e7072b474e71b2b61e989a0f7e76abc39fa.zip
use "localhost" in "Host" header line, if unix socket is used in "auth_http"
Diffstat (limited to 'src')
-rw-r--r--src/mail/ngx_mail_auth_http_module.c9
1 files changed, 8 insertions, 1 deletions
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) {