🐛 Update CORS settings

This commit is contained in:
LittleSheep 2024-09-16 18:00:09 +08:00
parent ecf8c574e4
commit b9fd5741f3

View File

@ -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
},