Quellcode durchsuchen

add:增加cors允许X-Device头

adam vor 6 Jahren
Ursprung
Commit
0f86ce329a
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1
    1
      middleware/cors/cors.go

+ 1
- 1
middleware/cors/cors.go Datei anzeigen

@@ -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 {