Explorar el Código

更新跨域配置

lijian hace 6 años
padre
commit
ad6ed0041d
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      services/knowoapi/main.go

+ 2 - 1
services/knowoapi/main.go

@@ -34,8 +34,9 @@ func main() {
 	opts := cors.Options{
 	opts := cors.Options{
 		AllowedOrigins: []string{"*"},
 		AllowedOrigins: []string{"*"},
 		AllowedHeaders: []string{"Content-Type"},
 		AllowedHeaders: []string{"Content-Type"},
-		AllowedMethods: []string{"POST,GET,DELETE,PUT"},
+		AllowedMethods: []string{"POST", "GET", "DELETE", "PUT"},
 		ExposedHeaders: []string{"X-Header"},
 		ExposedHeaders: []string{"X-Header"},
+		Debug:          true,
 	}
 	}
 	app.Use(cors.New(opts))
 	app.Use(cors.New(opts))
 	app.AllowMethods(iris.MethodOptions)
 	app.AllowMethods(iris.MethodOptions)