diff options
Diffstat (limited to 'internal')
-rw-r--r-- | internal/server/logging.go | 9 | ||||
-rw-r--r-- | internal/server/server.go | 4 |
2 files changed, 2 insertions, 11 deletions
diff --git a/internal/server/logging.go b/internal/server/logging.go index afcce6d..d70d927 100644 --- a/internal/server/logging.go +++ b/internal/server/logging.go @@ -22,20 +22,13 @@ func NewLoggingResponseWriter(w http.ResponseWriter) *LoggingResponseWriter { return &LoggingResponseWriter{w, http.StatusOK} } -type wrappedHandlerOptions struct { - defaultHostname string -} - -func wrapHandlerWithLogging(wrappedHandler http.Handler, opts wrappedHandlerOptions) http.Handler { +func wrapHandlerWithLogging(wrappedHandler http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { scheme := r.Header.Get("X-Forwarded-Proto") if scheme == "" { scheme = "http" } host := r.Host - if host == "" { - host = opts.defaultHostname - } lw := NewLoggingResponseWriter(w) wrappedHandler.ServeHTTP(lw, r) statusCode := lw.statusCode diff --git a/internal/server/server.go b/internal/server/server.go index 8838dbd..1dbd147 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -107,9 +107,7 @@ func New(runtimeConfig *Config) (*Server, error) { ReadHeaderTimeout: 1 * time.Minute, Handler: sentryHandler.Handle( serverHeaderHandler( - wrapHandlerWithLogging(top, wrappedHandlerOptions{ - defaultHostname: runtimeConfig.BaseURL.Hostname(), - }), + wrapHandlerWithLogging(top), ), ), }, |