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

Valentin V. Bartenev vbart at nginx.com
Mon Apr 17 18:43:09 UTC 2017


On Friday 07 April 2017 14:40:18 Piotr Sikora via nginx-devel wrote:
> Hey Valentin,
> 
> > Maybe "http2 pseudo-header: \":%V: %V\""?
> > Because it doesn't look like a valid "http header".
> 
> I was going back and forth between different versions, but I ended up
> using "http header", which matches rest of the headers and has the
> same alignment, because then pseudo-headers look like part of the same
> logical block, i.e.
> 
> [debug] 1#1: *1 http2 http header: ":method: GET"
> [debug] 1#1: *1 http2 http header: ":path: /h2x"
> [debug] 1#1: *1 http2 http header: ":scheme: http"
> [debug] 1#1: *1 http2 http header: ":authority: 127.0.0.1"
> [debug] 1#1: *1 http2 http header: "accept: */*"
> [debug] 1#1: *1 http2 http header: "accept-encoding: gzip, deflate"
> [debug] 1#1: *1 http2 http header: "user-agent: nghttp2/1.21.0-DEV"
> 
> vs
> 
> [debug] 1#1: *1 http2 pseudo-header: ":method: GET"
> [debug] 1#1: *1 http2 pseudo-header: ":path: /h2x"
> [debug] 1#1: *1 http2 pseudo-header: ":scheme: http"
> [debug] 1#1: *1 http2 pseudo-header: ":authority: 127.0.0.1"
> [debug] 1#1: *1 http2 http header: "accept: */*"
> [debug] 1#1: *1 http2 http header: "accept-encoding: gzip, deflate"
> [debug] 1#1: *1 http2 http header: "user-agent: nghttp2/1.21.0-DEV"
> 
> vs
> 
> [debug] 1#1: *1 http2 http pseudo-header: ":method: GET"
> [debug] 1#1: *1 http2 http pseudo-header: ":path: /h2x"
> [debug] 1#1: *1 http2 http pseudo-header: ":scheme: http"
> [debug] 1#1: *1 http2 http pseudo-header: ":authority: 127.0.0.1"
> [debug] 1#1: *1 http2 http header: "accept: */*"
> [debug] 1#1: *1 http2 http header: "accept-encoding: gzip, deflate"
> [debug] 1#1: *1 http2 http header: "user-agent: nghttp2/1.21.0-DEV"
> 
> The ":" prefix already indicates those are pseudo-headers, and because
> of different alignment, all the alternatives make them look like
> unrelated things.
> 
> This might be just a matter of taste, though, so if you feel strongly
> about one of the alternatives, then I can change it, just please be
> explicit about it.
> 

I think that pseudo-headers have different processing and shouldn't be
a part of the same block as normal http headers.  That's why I prefer
the second variant:

	http2 pseudo-header: ":method: GET"


 wbr, Valentin V. Bartenev


More information about the nginx-devel mailing list