Skip to content

Commit 10bc802

Browse files
Ngo The TrungFelipe Zimmerle
authored andcommitted
Use nginx's parsed hostname
1 parent 411dc15 commit 10bc802

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

nginx/modsecurity/ngx_http_modsecurity.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,12 +363,7 @@ ngx_http_modsecurity_load_request(ngx_http_request_t *r)
363363
/* &r->headers_in.user); */
364364
req->parsed_uri.fragment = (char *)ngx_pstrdup0(r->pool, &r->exten);
365365

366-
if (&r->headers_in != NULL && &r->headers_in.server != NULL) {
367-
req->hostname = (char *)ngx_pstrdup0(r->pool, &r->headers_in.server);
368-
} else {
369-
req->hostname = (char *)ngx_pstrdup0(r->pool,
370-
(ngx_str_t *)&ngx_cycle->hostname);
371-
}
366+
req->hostname = (char *)ngx_pstrdup0(r->pool, &r->headers_in.server);
372367

373368
if (r->header_only) {
374369
req->header_only = r->header_only;

0 commit comments

Comments
 (0)