-
Notifications
You must be signed in to change notification settings - Fork 237
Open
Description
app := freedom.NewApplication()
app.Iris().Use(func(ctx iris.Context) {
ctx.Header("Access-Control-Allow-Origin", "*")
ctx.Header("Access-Control-Allow-Credentials", "true")
ctx.Header("Access-Control-Allow-Headers", "*")
ctx.Header("Access-Control-Allow-Methods", "POST, OPTIONS, GET, PUT, DELETE")
if ctx.Method() == "OPTIONS" {
ctx.StatusCode(http.StatusOK)
return
}
ctx.Next()
})
app.Iris().AllowMethods(iris.MethodOptions)
这样做好像没有解决
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels