优化跨域处理
This commit is contained in:
parent
12d2735663
commit
2c201ae226
@ -82,6 +82,17 @@ func NewServer(port int, optionList ...SetServerOptionFunc) *server {
|
|||||||
// 跨域中间件
|
// 跨域中间件
|
||||||
globalMiddlewareList = append(globalMiddlewareList, request_cors.New(request_cors.Config{
|
globalMiddlewareList = append(globalMiddlewareList, request_cors.New(request_cors.Config{
|
||||||
AllowAllOrigins: true,
|
AllowAllOrigins: true,
|
||||||
|
AllowOrigins: nil,
|
||||||
|
AllowOriginFunc: nil,
|
||||||
|
AllowMethods: []string{"*"},
|
||||||
|
AllowHeaders: []string{"*"},
|
||||||
|
AllowCredentials: true,
|
||||||
|
ExposeHeaders: nil,
|
||||||
|
MaxAge: 0,
|
||||||
|
AllowWildcard: true,
|
||||||
|
AllowBrowserExtensions: true,
|
||||||
|
AllowWebSockets: true,
|
||||||
|
AllowFiles: true,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
if len(option.globalMiddlewareList) > 0 {
|
if len(option.globalMiddlewareList) > 0 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user