diff options
Diffstat (limited to 'srv/src/api/csrf.go')
-rw-r--r-- | srv/src/api/csrf.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/srv/src/api/csrf.go b/srv/src/api/csrf.go index 9717030..2a93ed7 100644 --- a/srv/src/api/csrf.go +++ b/srv/src/api/csrf.go @@ -10,6 +10,7 @@ import ( const ( csrfTokenCookieName = "csrf_token" csrfTokenHeaderName = "X-CSRF-Token" + csrfTokenFormName = "csrfToken" ) func setCSRFMiddleware(h http.Handler) http.Handler { @@ -45,7 +46,7 @@ func checkCSRFMiddleware(h http.Handler) http.Handler { givenCSRFTok := r.Header.Get(csrfTokenHeaderName) if givenCSRFTok == "" { - givenCSRFTok = r.FormValue("csrfToken") + givenCSRFTok = r.FormValue(csrfTokenFormName) } if csrfTok == "" || givenCSRFTok != csrfTok { |