Browse Source

add:增加cors允许X-Device头

adam 5 years ago
parent
commit
0f86ce329a
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      middleware/cors/cors.go

+ 1
- 1
middleware/cors/cors.go View File

@@ -12,7 +12,7 @@ func Cors() gin.HandlerFunc {
12 12
 	config := cors.DefaultConfig()
13 13
 
14 14
 	config.AddAllowMethods(http.MethodDelete, http.MethodOptions, http.MethodPatch)
15
-	config.AddAllowHeaders("Authorization", "X-Require-Cookie")
15
+	config.AddAllowHeaders("Authorization", "X-Require-Cookie", "X-Device")
16 16
 	config.AllowCredentials = true
17 17
 	config.AllowOriginFunc = func(origin string) bool {
18 18
 		if gin.Mode() == gin.DebugMode {