-
Notifications
You must be signed in to change notification settings - Fork 917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
为什么文档中没有写到跨域的支持呢?还要我到issue里面搜索出来 #939
Comments
你搜出来之后可以给我们发一个PR,发到这个仓库就可以的,社区需要大家一起改进 |
确实是……CORS这么重要的安全问题应该被重视。 recorder := httptest.NewRecorder()
handler := web.NewControllerRegister()
handler.InsertFilter("*", web.BeforeRouter, Allow(&Options{
AllowOrigins: []string{"https://aaa.com", "https://*.foo.com"},
}))
handler.Any("/foo", func(ctx *context.Context) {
ctx.Output.SetStatus(500)
})
origin := "https://bar.foo.com"
r, _ := http.NewRequest("PUT", "/foo", nil)
r.Header.Add("Origin", origin)
handler.ServeHTTP(recorder, r) 但是似乎流量全都经过 |
Use |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
为什么文档中没有写到跨域的支持呢?还要我到issue里面搜索出来
beego/beego#4726
The text was updated successfully, but these errors were encountered: