We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cdde120 commit 0751293Copy full SHA for 0751293
nginx/modsecurity/ngx_http_modsecurity.c
@@ -364,7 +364,12 @@ ngx_http_modsecurity_load_request(ngx_http_request_t *r)
364
/* &r->headers_in.user); */
365
req->parsed_uri.fragment = (char *)ngx_pstrdup0(r->pool, &r->exten);
366
367
- req->hostname = (char *)ngx_pstrdup0(r->pool, &r->headers_in.server);
+ if (&r->headers_in != NULL && &r->headers_in.server != NULL) {
368
+ req->hostname = (char *)ngx_pstrdup0(r->pool, &r->headers_in.server);
369
+ } else {
370
+ req->hostname = (char *)ngx_pstrdup0(r->pool,
371
+ (ngx_str_t *)&ngx_cycle->hostname);
372
+ }
373
374
if (r->header_only) {
375
req->header_only = r->header_only;
0 commit comments