diff options
author | Alan Pearce | 2024-05-22 15:44:11 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-22 15:44:11 +0200 |
commit | 1d9d4fc9812f9eb15e78398340053afb32a3c55a (patch) | |
tree | 3d87190f1cdc5c26ac2e53bb5e840987d90b34f5 | |
parent | 3e8f63bc06639d4ce2154b65da52c175fe31652f (diff) | |
download | website-1d9d4fc9812f9eb15e78398340053afb32a3c55a.tar.lz website-1d9d4fc9812f9eb15e78398340053afb32a3c55a.tar.zst website-1d9d4fc9812f9eb15e78398340053afb32a3c55a.zip |
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
-rw-r--r-- | internal/server/logging.go | 2 |
1 files changed, 1 insertions, 1 deletions
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 } |