diff --git a/wfe/context.go b/wfe/context.go index 1b1e5acdb22..b2e752f22cc 100644 --- a/wfe/context.go +++ b/wfe/context.go @@ -62,9 +62,6 @@ func (th *topHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { Extra: make(map[string]interface{}, 0), } w.Header().Set("Boulder-Request-ID", logEvent.ID) - if r.URL != nil { - logEvent.Endpoint = r.URL.String() - } defer th.logEvent(logEvent) th.wfe.ServeHTTP(logEvent, w, r) diff --git a/wfe/wfe.go b/wfe/wfe.go index f12ef5b4f97..7695e0ac882 100644 --- a/wfe/wfe.go +++ b/wfe/wfe.go @@ -11,6 +11,7 @@ import ( "net" "net/http" "net/url" + "path" "regexp" "strconv" "strings" @@ -155,6 +156,11 @@ func (wfe *WebFrontEndImpl) HandleFunc(mux *http.ServeMux, pattern string, h wfe logEvent.AddError("unable to make nonce: %s", err) } + logEvent.Endpoint = pattern + if request.URL != nil { + logEvent.Endpoint = path.Join(logEvent.Endpoint, request.URL.Path) + } + switch request.Method { case "HEAD": // Go's net/http (and httptest) servers will strip out the body