diff options
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 3876e39e7..461c028d9 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -722,6 +722,7 @@ ngx_http_process_request_headers(ngx_event_t *rev) { ssize_t n; ngx_int_t rc, rv, i; + ngx_str_t header; ngx_table_elt_t *h, **cookie; ngx_connection_t *c; ngx_http_request_t *r; @@ -771,6 +772,19 @@ ngx_http_process_request_headers(ngx_event_t *rev) if (rc == NGX_OK) { + if (r->invalid_header) { + + /* there was error while a header line parsing */ + + header.len = r->header_end - r->header_name_start; + header.data = r->header_name_start; + + ngx_log_error(NGX_LOG_INFO, rev->log, 0, + "client sent invalid header: \"%V\", ignored,", + &header); + continue; + } + /* a header line has been parsed successfully */ r->headers_n++; @@ -2371,6 +2385,11 @@ ngx_http_log_error(ngx_log_t *log, u_char *buf, size_t len) len -= p - buf; + if (ctx->request->server_name.data) { + p = ngx_snprintf(p, len, ", host: %V", &ctx->request->server_name); + len -= p - buf; + } + p = ngx_snprintf(p, len, ", URL: \"%V\"", &ctx->request->unparsed_uri); if (ctx->request->headers_in.referer == NULL) { |