From b65fdaad764314991f502f3702b904a11f0fe6e7 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 25 May 2024 18:10:06 +0200 Subject: refactor: don't log request Host, it's irrelevant to this server --- internal/server/logging.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'internal/server/logging.go') diff --git a/internal/server/logging.go b/internal/server/logging.go index bbe9469..372972f 100644 --- a/internal/server/logging.go +++ b/internal/server/logging.go @@ -51,20 +51,15 @@ func wrapHandlerWithLogging(wrappedHandler http.Handler, opts wrappedHandlerOpti if scheme == "" { scheme = "http" } - host := r.Host - if host == "" { - host = opts.defaultHostname - } lw := NewLoggingResponseWriter(w) wrappedHandler.ServeHTTP(lw, r) statusCode := lw.statusCode fmt.Fprintf( opts.logger, - "%s %s %d %s %s %s\n", + "%s %s %d %s %s\n", scheme, r.Method, statusCode, - host, r.URL.Path, lw.Header().Get("Location"), ) -- cgit 1.4.1