From 92956a153c2e7d5df9e0d3805e9e604dd0b978dc Mon Sep 17 00:00:00 2001 From: Michael Hunteman Date: Sat, 6 Jul 2024 18:09:18 -0700 Subject: Fix header check --- server/cmd/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) } -- cgit v1.2.3