fix: only enable cors for relay routers to avoid csrf attack

This commit is contained in:
JustSong committed 2023-09-17 11:44:38 +08:00
1 parent ab4fd3b1ca
commit 437b35e161
2 files changed
+1 -2

No files matched your search

+1
View File
@@ -8,6 +8,7 @@ import (
)
func SetRelayRouter(router *gin.Engine) {
router.Use(middleware.CORS())
// https://platform.openai.com/docs/api-reference/introduction
modelsRouter := router.Group("/v1/models")
modelsRouter.Use(middleware.TokenAuth())