diff options
author | Alan Pearce | 2024-06-28 21:11:56 +0200 |
---|---|---|
committer | Alan Pearce | 2024-06-28 21:12:04 +0200 |
commit | 8606328379e7021a2e4bf0d56c0602fa595fa72e (patch) | |
tree | 0a3d1825fd1fcef83e48e0c4fda7f2b350398f31 /internal/server/logging.go | |
parent | 8517cc3937c64dbe78f60a7b33b8c0ea1e8cb8e9 (diff) | |
download | website-8606328379e7021a2e4bf0d56c0602fa595fa72e.tar.lz website-8606328379e7021a2e4bf0d56c0602fa595fa72e.tar.zst website-8606328379e7021a2e4bf0d56c0602fa595fa72e.zip |
remove unnecessary assignments
Diffstat (limited to 'internal/server/logging.go')
-rw-r--r-- | internal/server/logging.go | 6 |
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"), ) |