tbs
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 46s

This commit is contained in:
2024-12-06 21:54:59 +01:00
parent 58946eb488
commit ed05b99deb
5 changed files with 192 additions and 45 deletions

View File

@@ -11,12 +11,17 @@ func CrossSiteRequestForgery(auth *service.Auth) func(http.Handler) http.Handler
// session := r.Context().Value(SessionKey)
if r.Method == "POST" {
if r.Method == http.MethodPost ||
r.Method == http.MethodPut ||
r.Method == http.MethodDelete ||
r.Method == http.MethodPatch {
csrfToken := r.FormValue("csrf-token")
if csrfToken == "" {
http.Error(w, "", http.StatusForbidden)
return
}
}
next.ServeHTTP(w, r)