summaryrefslogtreecommitdiff
path: root/src/http/csrf.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/csrf.go')
-rw-r--r--src/http/csrf.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/http/csrf.go b/src/http/csrf.go
index 707aac4..a4f7e73 100644
--- a/src/http/csrf.go
+++ b/src/http/csrf.go
@@ -31,10 +31,12 @@ func checkCSRF(r *http.Request, publicURL *url.URL) error {
}
func (a *api) checkCSRFMiddleware(h http.Handler) http.Handler {
+ logger := a.params.Logger.WithNamespace("csrf")
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
+ ctx := r.Context()
if err := checkCSRF(r, a.params.PublicURL); err != nil {
- apiutil.BadRequest(rw, r, errors.New("invalid Referer"))
+ apiutil.BadRequest(ctx, logger, rw, "invalid Referer")
return
}