fix(cors): add PATCH to allowed methods

Without PATCH in CORS headers, user update was failing with:
'Method PATCH is not allowed by Access-Control-Allow-Methods'
This commit is contained in:
Tiago Yamamoto 2025-12-26 00:59:04 -03:00
parent aa97d86d0e
commit eae3df7f38

View file

@ -37,7 +37,7 @@ func CORSMiddleware(next http.Handler) http.Handler {
// Essential for some auth flows (cookies)
w.Header().Set("Access-Control-Allow-Credentials", "true")
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, PATCH, DELETE")
w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization")
if r.Method == "OPTIONS" {