-
Notifications
You must be signed in to change notification settings - Fork 38
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 #15
Comments
I tried the following in order to satisfy an CORS error: const headers = { But the above header setting does not work. it showed up in the out-going request as this: Access-Control-Request-Headers:access-control-allow-credentials, content-type. As result the request comes back with the same CORS error. |
On the backend(assuming express), you need to do something like this: var cors = require('cors');
app.use(cors({
origin: 'https://myurl.com',
credentials: true,
})); |
@arunoda, you are suggesting the change on our API server side. Actually I was able to get thru using jQuery. Seems the call will work as long as the header "Access-Control-Allow-Credentials=true" is present in the call. The fact that I can get the result via jQuery seems to show that our server setup is OK. But your http transport simply does not honor the setting I explicitly set as shown above. Which was the reason of the failing... Appreciate it if you could fix... thanks! @reggi , looping you in on this |
@arunoda , any chance this has been fixed? what I reported above is this: I set the header as this: const headers = { But the actual header set by your code is this: If I explicitly set 'Access-Control-Allow-Credentials' to 'true', why can't the actual header to be set as "Access-Control-Allow-Credentials:true" when the http request actually goes out (exactly as I set)? Appreciate if you could take a look? thanks! |
I am also facing the issue of not being able to set @arunoda Are you still using your fork? |
So is this project just dead now ...? |
Anything I need to do to setup CORS? Having a bit of trouble.
The text was updated successfully, but these errors were encountered: