# HG changeset patch # User Maxim Dounin # Date 1505405163 -10800 # Node ID d77407baccd15d22dea76c6fb7c84629b22b9455 # Parent 0846dd76a487ceffcc16702af70d8b45e926c84f HTTP/2: added logging of 400 (Bad Request) reasons. diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c --- a/src/http/v2/ngx_http_v2.c +++ b/src/http/v2/ngx_http_v2.c @@ -3337,6 +3337,19 @@ ngx_http_v2_construct_request_line(ngx_h || r->schema_start == NULL || r->unparsed_uri.len == 0) { + if (r->method_name.len == 0) { + ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, + "client sent no :method header"); + + } else if (r->schema_start == NULL) { + ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, + "client sent no :schema header"); + + } else { + ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, + "client sent no :path header"); + } + ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST); return NGX_ERROR; }