正在显示
1 个修改的文件
包含
4 行增加
和
6 行删除
@@ -81,14 +81,12 @@ var AllowOption = func(ctx *context.Context) { | @@ -81,14 +81,12 @@ var AllowOption = func(ctx *context.Context) { | ||
81 | return | 81 | return |
82 | } | 82 | } |
83 | f := cors.Allow(&cors.Options{ | 83 | f := cors.Allow(&cors.Options{ |
84 | - // AllowOrigins: []string{"*"}, //允许的请求来源 | ||
85 | AllowMethods: []string{"POST", "GET", "OPTIONS", "PUT", "DELETE"}, //允许的请求类型 | 84 | AllowMethods: []string{"POST", "GET", "OPTIONS", "PUT", "DELETE"}, //允许的请求类型 |
86 | - // AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin", | ||
87 | - // "x-mmm-cid", "x-mmm-uid", "x-mmm-accesstoken", "x-mmm-refreshtoken"}, //允许的头部信息 | ||
88 | - AllowHeaders: []string{"*"}, | 85 | + AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin", |
86 | + "x-mmm-cid", "x-mmm-uid", "x-mmm-accesstoken", "x-mmm-refreshtoken"}, //允许的头部信息 | ||
89 | ExposeHeaders: []string{"Content-Length", "Content-Type", "Access-Control-Allow-Origin"}, //允许暴露的头信息 | 87 | ExposeHeaders: []string{"Content-Length", "Content-Type", "Access-Control-Allow-Origin"}, //允许暴露的头信息 |
90 | - AllowCredentials: false, | ||
91 | - AllowAllOrigins: true, //不允许共享AuthTuffic证书 | 88 | + AllowCredentials: false, //不允许共享AuthTuffic证书 |
89 | + AllowAllOrigins: true, //允许的请求来源 | ||
92 | }) | 90 | }) |
93 | f(ctx) | 91 | f(ctx) |
94 | ctx.Output.Body([]byte("{}")) | 92 | ctx.Output.Body([]byte("{}")) |
-
请 注册 或 登录 后发表评论