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

Piotr Sikora piotrsikora at google.com
Fri Apr 7 21:40:18 UTC 2017


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.

Best regards,
Piotr Sikora


More information about the nginx-devel mailing list