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

预检请求, 请求头中方 token has been blocked by CORS policy: Request header field token is not allowed by Access-Control-Allow-Headers in preflight response. #15

Open
wan-wing opened this issue Jun 18, 2024 · 0 comments

Comments

@wan-wing
Copy link
Owner

wan-wing commented Jun 18, 2024

https://blog.csdn.net/qq_41359758/article/details/115031701
 由于在后端拦截器中拦截了所有的请求,只有检查到请求头中真实存在的token值才会放行请求,这就导致了浏览器发起的预检请求也被拦截了(由于该请求头中没有携带自定义的 Authorization 属性,所以被拦截),最终导致正式的 XMLHttpRequest 请求没有发出去。

https://blog.csdn.net/fuzhongbin/article/details/106239664

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