Fix: cors middleware should be applied directly to root router

This commit is contained in:
HFO4
2019-12-29 13:15:09 +08:00
parent ac2de841d2
commit b5ee3ee609
4 changed files with 8 additions and 10 deletions

View File

@@ -56,7 +56,6 @@ type thumb struct {
// 跨域配置
type cors struct {
AllowAllOrigins bool
AllowOrigins []string
AllowMethods []string
AllowHeaders []string

View File

@@ -38,7 +38,6 @@ var CaptchaConfig = &captcha{
// CORSConfig 跨域配置
var CORSConfig = &cors{
AllowAllOrigins: false,
AllowOrigins: []string{"UNSET"},
AllowMethods: []string{"PUT", "POST", "GET", "OPTIONS"},
AllowHeaders: []string{"Cookie", "Content-Length", "Content-Type", "X-Path", "X-FileName"},