bugfix: 通过修改配置文件使得跨域白名单正常生效 (#1296)
* bugfix: 通过修改配置文件使得跨域白名单正常生效 Co-authored-by: 奇淼(piexlmax <qimiaojiangjizhao@gmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
奇淼(piexlmax
parent
e67354f34c
commit
b6f3038a73
@@ -52,7 +52,7 @@ func CorsByRules() gin.HandlerFunc {
|
||||
c.AbortWithStatus(http.StatusForbidden)
|
||||
} else {
|
||||
// 非严格白名单模式,无论是否通过检查均放行所有 OPTIONS 方法
|
||||
if c.Request.Method == "OPTIONS" {
|
||||
if c.Request.Method == http.MethodOptions {
|
||||
c.AbortWithStatus(http.StatusNoContent)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user