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:
parent
aa97d86d0e
commit
eae3df7f38
1 changed files with 1 additions and 1 deletions
|
|
@ -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" {
|
||||
|
|
|
|||
Loading…
Reference in a new issue