From b9fd5741f3eee27cd0a6729dbfa1be5668901580 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Mon, 16 Sep 2024 18:00:09 +0800 Subject: [PATCH] :bug: Update CORS settings --- pkg/internal/server/server.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/pkg/internal/server/server.go b/pkg/internal/server/server.go index e3901cc..50b06cc 100644 --- a/pkg/internal/server/server.go +++ b/pkg/internal/server/server.go @@ -1,8 +1,6 @@ package server import ( - "strings" - "git.solsynth.dev/hydrogen/dealer/pkg/internal/server/api" "git.solsynth.dev/hydrogen/dealer/pkg/internal/server/exts" "github.com/gofiber/fiber/v2" @@ -34,15 +32,7 @@ func NewServer() *HTTPApp { app.Use(idempotency.New()) app.Use(cors.New(cors.Config{ AllowCredentials: true, - AllowMethods: strings.Join([]string{ - fiber.MethodGet, - fiber.MethodPost, - fiber.MethodHead, - fiber.MethodOptions, - fiber.MethodPut, - fiber.MethodDelete, - fiber.MethodPatch, - }, ","), + AllowMethods: "GET,POST,HEAD,PUT,DELETE,PATCH", AllowOriginsFunc: func(origin string) bool { return true },