diff --git a/http_middleware.go b/http_middleware.go index 5f477d4..e684fc0 100644 --- a/http_middleware.go +++ b/http_middleware.go @@ -1,9 +1,17 @@ package main -import "net/http" +import ( + "net/http" + "strings" +) func loggingMiddleware(next http.HandlerFunc) http.HandlerFunc { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if strings.HasPrefix(r.URL.Path, "/static/") || strings.HasPrefix(r.URL.Path, "/favicon") { + next.ServeHTTP(w, r) + return + } + path := r.URL.Path if r.URL.RawQuery != "" { path += "?" + r.URL.RawQuery