Skip to content

Commit

Permalink
fix: cros
Browse files Browse the repository at this point in the history
  • Loading branch information
zijiren233 committed Jan 5, 2025
1 parent b92a620 commit c6fd01a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions service/aiproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ func setupHTTPServer() (*http.Server, *gin.Engine) {

w := log.StandardLogger().Writer()
server.
Use(middleware.NewLog(log.StandardLogger())).
Use(gin.RecoveryWithWriter(w)).
Use(middleware.RequestID)
Use(middleware.NewLog(log.StandardLogger())).
Use(middleware.RequestID, middleware.CORS())
router.SetRouter(server)

port := os.Getenv("PORT")
Expand Down
5 changes: 1 addition & 4 deletions service/aiproxy/router/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ import (
func SetRelayRouter(router *gin.Engine) {
// https://platform.openai.com/docs/api-reference/introduction
v1Router := router.Group("/v1")
v1Router.Use(
middleware.CORS(),
middleware.TokenAuth,
)
v1Router.Use(middleware.TokenAuth)

modelsRouter := v1Router.Group("/models")
{
Expand Down

0 comments on commit c6fd01a

Please sign in to comment.