-
Notifications
You must be signed in to change notification settings - Fork 5
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 issue when request was made with credentials #10
Comments
We are already using CORS headers. It should work already. You can see how we enable CORS headers here: https://github.com/muratcorlu/cli-api-mocker/blob/master/src/index.js#L73 |
Yep, by default "cors()" set the Access-Control-Allow-Origin to "*" which Chrome will reject when the request was made with "credentials" flag enabled. It throws error something like:
|
I'll try to reproduce problem with an example and understand what is exactly needed for fixing it. |
Hi muratcorlu, I this issue solved. I am also getting the same issue Access-Control-Allow-Origin to "*"
|
Chrome will block the request with credentials enabled (https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials) to mock server because the server returns " Access-Control-Allow-Origin: * "
It's an easy fix - we just need to pass custom cors options to express. I was gonna submit PR but can't seem to push the branch - getting 403.
The text was updated successfully, but these errors were encountered: