diff options
author | Michael Hunteman <michael@huntm.net> | 2024-07-06 18:09:18 -0700 |
---|---|---|
committer | Michael Hunteman <michael@huntm.net> | 2024-07-06 18:09:18 -0700 |
commit | 92956a153c2e7d5df9e0d3805e9e604dd0b978dc (patch) | |
tree | d554b2972a323ebc04875f3bf56ef735bfd58a52 /server/cmd | |
parent | 8c65e5d0d8d62028d1f3ae59ae358eb7a2820dd0 (diff) |
Fix header check
Diffstat (limited to 'server/cmd')
-rw-r--r-- | server/cmd/main.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/cmd/main.go b/server/cmd/main.go index 83a64af..b747aba 100644 --- a/server/cmd/main.go +++ b/server/cmd/main.go @@ -212,7 +212,7 @@ func enableCors(next http.Handler) http.Handler { allowedOrigins := []string{"http://localhost:5173", "http://192.168.1.41:5173"} allowedMethods := []string{"OPTIONS", "POST", "PUT"} return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - method := r.Header.Get("Method") + method := r.Header.Get("Access-Control-Request-Method") if isPreflight(r) && slices.Contains(allowedMethods, method) { w.Header().Add("Access-Control-Allow-Methods", method) } |