From 10bc802ee0caebee8d4e68c82c4f8ab869bcc515 Mon Sep 17 00:00:00 2001 From: Ngo The Trung Date: Wed, 28 Oct 2015 14:45:02 +0800 Subject: [PATCH] Use nginx's parsed hostname --- nginx/modsecurity/ngx_http_modsecurity.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/nginx/modsecurity/ngx_http_modsecurity.c b/nginx/modsecurity/ngx_http_modsecurity.c index 2f99ab4b..75ab9467 100644 --- a/nginx/modsecurity/ngx_http_modsecurity.c +++ b/nginx/modsecurity/ngx_http_modsecurity.c @@ -363,12 +363,7 @@ ngx_http_modsecurity_load_request(ngx_http_request_t *r) /* &r->headers_in.user); */ req->parsed_uri.fragment = (char *)ngx_pstrdup0(r->pool, &r->exten); - if (&r->headers_in != NULL && &r->headers_in.server != NULL) { - req->hostname = (char *)ngx_pstrdup0(r->pool, &r->headers_in.server); - } else { - req->hostname = (char *)ngx_pstrdup0(r->pool, - (ngx_str_t *)&ngx_cycle->hostname); - } + req->hostname = (char *)ngx_pstrdup0(r->pool, &r->headers_in.server); if (r->header_only) { req->header_only = r->header_only;