all repos — homestead @ 88354643d51ab7d2f7c7036327e88dca58a2ba2d

Code for my website

remove unnecessary assignments

Alan Pearce
commit

88354643d51ab7d2f7c7036327e88dca58a2ba2d

parent

24b03be7f5400fa43cf3f4d6ac4e8e3eec92fdbc

1 file changed, 2 insertions(+), 4 deletions(-)

jump to
M internal/server/logging.gointernal/server/logging.go
@@ -24,18 +24,16 @@ }
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"), )