We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d23faa1 commit 4cc436aCopy full SHA for 4cc436a
nginx/modsecurity/ngx_http_modsecurity.c
@@ -363,9 +363,12 @@ ngx_http_modsecurity_load_request(ngx_http_request_t *r)
363
/* &r->headers_in.user); */
364
req->parsed_uri.fragment = (char *)ngx_pstrdup0(r->pool, &r->exten);
365
366
- req->hostname = (char *)ngx_pstrdup0(r->pool,
+ 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
+ }
372
373
if (r->header_only) {
374
req->header_only = r->header_only;
0 commit comments