Skip to content
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

在路由组上注册跨域中间件时,复杂跨域请求会报CORS策略阻止错误。 #250

Open
dotqi opened this issue Dec 7, 2022 · 0 comments

Comments

@dotqi
Copy link

dotqi commented Dec 7, 2022

在路由组上注册跨域中间件时。如 iweb.HttpServer.Group("/api").Use(cors.New("")) 。
当进行简单跨域请求时一切正常。

当进行复杂跨域请求时。用iweb.HttpServer.SetEnabledAutoOPTIONS(true)自动注册OPTIONS请求。会提示已被CORS策略阻止错误。
如果手动注册OPTIONS请求时一切正常。如 apiGroup.OPTIONS(”/app“, dotweb.DefaultAutoOPTIONSHandler)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant