From 316a1540c58f534987bb1ad554cdfce2d73815a2 Mon Sep 17 00:00:00 2001 From: CrazyBolillo Date: Thu, 25 Jul 2024 08:47:25 -0600 Subject: [PATCH] fix: support most HTTP methods for CORS --- cmd/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/main.go b/cmd/main.go index 143e0d5..287873d 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -41,6 +41,7 @@ func serve(ctx context.Context) error { r := chi.NewRouter() r.Use(cors.Handler(cors.Options{ AllowedOrigins: strings.Split(os.Getenv("CORS_ALLOWED_ORIGINS"), ","), + AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"}, })) r.Use(middleware.AllowContentEncoding("application/json"))