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

This commit is contained in:
JustSong
2023-09-17 11:44:38 +08:00
parent 0d50ad4b2b
commit 25c4c111ab
2 changed files with 1 additions and 2 deletions

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())