]> git.kaiwu.me - nginx.git/commitdiff
use "localhost" in "Host" header line, if unix socket is used in "auth_http"
authorIgor Sysoev <igor@sysoev.ru>
Fri, 25 Dec 2009 15:43:40 +0000 (15:43 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Fri, 25 Dec 2009 15:43:40 +0000 (15:43 +0000)
src/mail/ngx_mail_auth_http_module.c

index c755c72212178263332f9270c1ea5929ff37a4f8..b9f96357858bff9522e6d3ab250d4689bd00cf79 100644 (file)
@@ -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) {