Skip to content

Commit dd40856

Browse files
committed
refactor(server): update CORS parameters
1 parent 7c1978a commit dd40856

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cmd/backend/dependencies.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,10 @@ func GinEngine(services []httpapi.Service, authStorage auth.Storage, gqlgenHandl
7777
engine.Use(gin.Recovery())
7878
engine.Use(httputils.MachineMiddleware())
7979
engine.Use(cors.New(cors.Config{
80-
AllowOrigins: cfg.AllowedOrigins,
81-
AllowMethods: []string{"GET", "POST", "OPTIONS"},
82-
AllowHeaders: []string{"Content-Type", "User-Agent", "Referer"},
83-
AllowCredentials: true,
84-
MaxAge: 24 * time.Hour,
80+
AllowOrigins: cfg.AllowedOrigins,
81+
AllowMethods: []string{"GET", "POST", "OPTIONS"},
82+
AllowHeaders: []string{"Content-Type", "User-Agent", "Referer", "Authorization"},
83+
MaxAge: 24 * time.Hour,
8584
}))
8685

8786
router := engine.Group("/")

0 commit comments

Comments
 (0)