Explorar el Código

add:增加cors允许X-Device头

adam hace 6 años
padre
commit
0f86ce329a
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1
    1
      middleware/cors/cors.go

+ 1
- 1
middleware/cors/cors.go Ver fichero

12
 	config := cors.DefaultConfig()
12
 	config := cors.DefaultConfig()
13
 
13
 
14
 	config.AddAllowMethods(http.MethodDelete, http.MethodOptions, http.MethodPatch)
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
 	config.AllowCredentials = true
16
 	config.AllowCredentials = true
17
 	config.AllowOriginFunc = func(origin string) bool {
17
 	config.AllowOriginFunc = func(origin string) bool {
18
 		if gin.Mode() == gin.DebugMode {
18
 		if gin.Mode() == gin.DebugMode {