浏览代码

更新跨域配置

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)