]> git.kaiwu.me - nginx.git/commitdiff
HTTP/2: added logging of 400 (Bad Request) reasons.
authorMaxim Dounin <mdounin@mdounin.ru>
Thu, 14 Sep 2017 16:06:03 +0000 (19:06 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Thu, 14 Sep 2017 16:06:03 +0000 (19:06 +0300)
src/http/v2/ngx_http_v2.c

index d99dd83421c7371fa0a383f35581ab6789988f0e..2d60f49361f14185a3ccbd6fe5b54185115202c9 100644 (file)
@@ -3337,6 +3337,19 @@ ngx_http_v2_construct_request_line(ngx_http_request_t *r)
         || 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;
     }