瀏覽代碼

add more allowed header

Paul 4 年之前
父節點
當前提交
1d7b8f136d
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      middleware/cors/cors.go

+ 1
- 1
middleware/cors/cors.go 查看文件

@@ -13,7 +13,7 @@ func Cors() gin.HandlerFunc {
13 13
 
14 14
 	config.AddAllowMethods(http.MethodDelete, http.MethodOptions, http.MethodPatch)
15 15
 	// x-requested-with antd上传组件需要
16
-	config.AddAllowHeaders("Authorization", "X-Require-Cookie", "X-Device", "x-requested-with", "X-Tourist-Id")
16
+	config.AddAllowHeaders("User-Agent", "Lang", "Authorization", "X-Require-Cookie", "X-Device", "x-requested-with", "X-Tourist-Id")
17 17
 	config.AllowCredentials = true
18 18
 	config.AllowOriginFunc = func(origin string) bool {
19 19
 		if gin.Mode() == gin.DebugMode {