changeset 7106:d77407baccd1

HTTP/2: added logging of 400 (Bad Request) reasons.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 14 Sep 2017 19:06:03 +0300
parents 0846dd76a487
children d4b031cf32cf
files src/http/v2/ngx_http_v2.c
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/v2/ngx_http_v2.c	Tue Sep 12 13:44:04 2017 +0300
+++ b/src/http/v2/ngx_http_v2.c	Thu Sep 14 19:06:03 2017 +0300
@@ -3337,6 +3337,19 @@
         || 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;
     }