From 1d9d4fc9812f9eb15e78398340053afb32a3c55a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 22 May 2024 15:44:11 +0200 Subject: fix logging of host header why on earth does net/http **remove** the host header and not make it clear? It's only "documented" in the comments of the fields of the Request struct and not even hinted at in the Header() documentation --- internal/server/logging.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal') diff --git a/internal/server/logging.go b/internal/server/logging.go index fcdab18..65dcb87 100644 --- a/internal/server/logging.go +++ b/internal/server/logging.go @@ -32,7 +32,7 @@ func wrapHandlerWithLogging(wrappedHandler http.Handler, opts wrappedHandlerOpti if scheme == "" { scheme = "http" } - host := r.Header.Get("Host") + host := r.Host if host == "" { host = opts.defaultHostname } -- cgit 1.4.1