add debug log

This commit is contained in:
Adrien PONSIN 2025-04-15 19:48:15 +02:00
parent 22ab7e250b
commit beadb78fd3
No known key found for this signature in database
GPG Key ID: 7B4D4A32C05C475E

View File

@ -188,6 +188,7 @@ func checkMethodPath(w http.ResponseWriter, r *http.Request, mr methodRegex) err
http.Error(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed) http.Error(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed)
return ErrHTTPMethodNotAllowed{httpMethod: r.Method} return ErrHTTPMethodNotAllowed{httpMethod: r.Method}
} }
log.Debug().Msgf("%s is a registered HTTP method", r.Method)
if !req.MatchString(r.URL.Path) { if !req.MatchString(r.URL.Path) {
http.Error(w, http.StatusText(http.StatusForbidden), http.StatusForbidden) http.Error(w, http.StatusText(http.StatusForbidden), http.StatusForbidden)
return ErrNoMatch{ return ErrNoMatch{
@ -195,6 +196,7 @@ func checkMethodPath(w http.ResponseWriter, r *http.Request, mr methodRegex) err
httpMethod: r.Method, httpMethod: r.Method,
} }
} }
log.Debug().Msgf("%s matches %s", r.URL.Path, req.String())
return nil return nil
} }