Small fix on the top of the patch #950

This commit is contained in:
Felipe Zimmerle
2015-12-10 14:39:02 -03:00
parent e76e912bab
commit 411dc15a4a

View File

@@ -363,9 +363,12 @@ 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);
req->hostname = (char *)ngx_pstrdup0(r->pool,
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);
}
if (r->header_only) {
req->header_only = r->header_only;