mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-09 23:53:41 +08:00
fix: only enable cors for relay routers to avoid csrf attack
This commit is contained in:
2
main.go
2
main.go
@@ -7,7 +7,6 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"one-api/common"
|
||||
"one-api/controller"
|
||||
"one-api/middleware"
|
||||
"one-api/model"
|
||||
"one-api/router"
|
||||
"os"
|
||||
@@ -88,7 +87,6 @@ func main() {
|
||||
server := gin.Default()
|
||||
// This will cause SSE not to work!!!
|
||||
//server.Use(gzip.Gzip(gzip.DefaultCompression))
|
||||
server.Use(middleware.CORS())
|
||||
|
||||
// Initialize session store
|
||||
store := cookie.NewStore([]byte(common.SessionSecret))
|
||||
|
||||
Reference in New Issue
Block a user