Merge pull request #186 from skrashevich/fix-cors-auth

Fix CORS for Basic auth
This commit is contained in:
Alex X
2023-04-14 06:29:13 +03:00
committed by GitHub

View File

@@ -121,6 +121,7 @@ func middlewareCORS(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS")
w.Header().Set("Access-Control-Allow-Headers", "Authorization")
next.ServeHTTP(w, r)
})
}