about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-06-28 21:11:56 +0200
committerAlan Pearce2024-06-28 21:12:04 +0200
commit8606328379e7021a2e4bf0d56c0602fa595fa72e (patch)
tree0a3d1825fd1fcef83e48e0c4fda7f2b350398f31
parent8517cc3937c64dbe78f60a7b33b8c0ea1e8cb8e9 (diff)
downloadwebsite-8606328379e7021a2e4bf0d56c0602fa595fa72e.tar.lz
website-8606328379e7021a2e4bf0d56c0602fa595fa72e.tar.zst
website-8606328379e7021a2e4bf0d56c0602fa595fa72e.zip
remove unnecessary assignments
-rw-r--r--internal/server/logging.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/internal/server/logging.go b/internal/server/logging.go
index 5d607bb..7df35d7 100644
--- a/internal/server/logging.go
+++ b/internal/server/logging.go
@@ -24,18 +24,16 @@ func NewLoggingResponseWriter(w http.ResponseWriter) *LoggingResponseWriter {
 
 func wrapHandlerWithLogging(wrappedHandler http.Handler) http.Handler {
 	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
-		host := r.Host
 		lw := NewLoggingResponseWriter(w)
 		wrappedHandler.ServeHTTP(lw, r)
 		if r.URL.Path == "/health" {
 			return
 		}
-		statusCode := lw.statusCode
 		log.Info(
 			"http request",
 			"method", r.Method,
-			"status", statusCode,
-			"host", host,
+			"status", lw.statusCode,
+			"host", r.Host,
 			"path", r.URL.Path,
 			"location", lw.Header().Get("Location"),
 		)