From da31edf03a1f23c031ccbdae00ada43846cfd8c9 Mon Sep 17 00:00:00 2001 From: Raajheer1 Date: Sun, 1 Sep 2024 12:24:22 -0500 Subject: [PATCH] allow PATCH --- pkg/go-chi/cors.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/go-chi/cors.go b/pkg/go-chi/cors.go index 5f8e673..05b2957 100644 --- a/pkg/go-chi/cors.go +++ b/pkg/go-chi/cors.go @@ -3,14 +3,16 @@ package go_chi import ( "github.com/VATUSA/primary-api/pkg/config" "github.com/go-chi/cors" + log "github.com/sirupsen/logrus" "strings" ) func NewCors(cfg *config.Config) cors.Options { allowedOrigins := strings.Split(cfg.Cors.AllowedOrigins, ",") + log.Debug("Allowed Origins: ", allowedOrigins) return cors.Options{ AllowedOrigins: allowedOrigins, - AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"}, + AllowedMethods: []string{"GET", "POST", "PATCH", "PUT", "DELETE", "OPTIONS"}, AllowedHeaders: []string{"Accept", "Authorization", "Content-Type", "x-guest", "x-user", "x-api-key"}, AllowCredentials: true, MaxAge: 300,