fix(cors): add proper CORS configuration for content routes

pull/3192/head
zhchen8 3 weeks ago
parent a908ec462f
commit b8be8c4ca6

@ -600,6 +600,10 @@ func initMasterRouter(dep dependency.Dep) *gin.Engine {
content := file.Group("content")
contentCors := cors.New(cors.Config{
AllowOrigins: []string{"*"},
AllowMethods: []string{"GET", "HEAD", "OPTIONS"},
AllowHeaders: []string{"Range", "If-Range", "Authorization", "Content-Type"},
ExposeHeaders: []string{"Content-Range", "Accept-Ranges", "Content-Length", "Content-Disposition"},
AllowCredentials: false, // 使用 "*" 时必须为 false
})
content.Use(contentCors)
{

Loading…
Cancel
Save