about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-05-22 15:44:11 +0200
committerAlan Pearce2024-05-22 15:44:11 +0200
commit1d9d4fc9812f9eb15e78398340053afb32a3c55a (patch)
tree3d87190f1cdc5c26ac2e53bb5e840987d90b34f5
parent3e8f63bc06639d4ce2154b65da52c175fe31652f (diff)
downloadwebsite-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.go2
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
 		}