소스 검색

更新跨域配置

lijian 6 년 전
부모
커밋
ad6ed0041d
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      services/knowoapi/main.go

+ 2 - 1
services/knowoapi/main.go

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