[PATCH] HTTP/2: add debug logging of pseudo-headers and cookies

Piotr Sikora piotrsikora at google.com
Sun Apr 9 12:27:22 UTC 2017


# HG changeset patch
# User Piotr Sikora <piotrsikora at google.com>
# Date 1490516711 25200
#      Sun Mar 26 01:25:11 2017 -0700
# Node ID 7e98d1dbb9ffc83a4ae621e05f8ebdc23fdf3b70
# Parent  22be63bf21edaa1b8ea916c7d8cd4e5fe4892061
HTTP/2: add debug logging of pseudo-headers and cookies.

Signed-off-by: Piotr Sikora <piotrsikora at google.com>

diff -r 22be63bf21ed -r 7e98d1dbb9ff src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c
+++ b/src/http/v2/ngx_http_v2.c
@@ -1585,6 +1585,10 @@ ngx_http_v2_state_process_header(ngx_htt
         rc = ngx_http_v2_pseudo_header(r, header);
 
         if (rc == NGX_OK) {
+            ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+                           "http2 http header: \":%V: %V\"",
+                           &header->name, &header->value);
+
             return ngx_http_v2_state_header_complete(h2c, pos, end);
         }
 
@@ -1626,6 +1630,10 @@ ngx_http_v2_state_process_header(ngx_htt
                                                 NGX_HTTP_V2_INTERNAL_ERROR);
         }
 
+        ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+                       "http2 http header: \"%V: %V\"",
+                       &header->name, &header->value);
+
         return ngx_http_v2_state_header_complete(h2c, pos, end);
     }
 


More information about the nginx-devel mailing list