Open sashee opened 4 years ago
This is a result of Go-lang net/http
library behavior, see https://golang.org/src/net/http/request.go#L159
// For incoming requests, the Host header is promoted to the // Request.Host field and removed from the Header map.
:(
On the other hand the Request.Host
field does not contain a host header only instead it is defined as following: https://golang.org/src/net/http/request.go#L221
TL;DR: if Host
-header is not defined, Request.Host
will contain a host part of the URL the request was made to :(
In order to expose Host
-header properly I need to find out how to either get an access to the raw HTTP-request, or how to figure out that Request.Host
field contains the host header and not the part of URL
When I send a request with a different Host header then the request is logged successfully but the Host is missing.
Shows:
Testing with webhooks.site the host header is listed:
This prevents debugging host-related issues.