-
Notifications
You must be signed in to change notification settings - Fork 113
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 #65
Comments
Can you show the error message from the hertz server? |
hertz没报错。。。 |
Maybe you can show the debug information of the browser in developer mode. |
This doesn't seem to be a server-side issue, is it related to the |
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
POST http://localhost:5173/api/route_name 500 (Internal Server Error)
前后端联调时,一直报500,应该就是后端的跨域配置有问题, 前端配置了 myAxios.defaults.withCredentials = true;
后端使用cors无效
h.Use(cors.New(cors.Config{
AllowAllOrigins: true,
AllowCredentials: true,
AllowMethods: []string{"GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"},
AllowHeaders: []string{"Origin", "Content-Length", "Content-Type"},
}))
换成gin框架就可以,是我配置的有问题嘛
The text was updated successfully, but these errors were encountered: