traefik / whoami

Tiny Go server that prints os information and HTTP request to output

Home Page:https://traefik.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Protocol HTTP display error

21ki opened this issue · comments

commented

image

+1

I stumbled over the same. This is not a bug but intended by the go standard library as http2 is transmitted in binary format. They decided to print the HTTP1.1 equivalent request.

It is even hard coded in the http/Request.Write(w io.Writer) that whoami is using to print the request.

A bit more context is given in the documentation for httputil/DumpRequest.

However, whoami logs the correct protocl used if you use the -verbose flag:

2024/03/07 15:08:17 127.0.0.1:41214 - - [07/Mar/2024:15:08:17 +0100] "GET / HTTP/2.0" - -