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

Adding support XMLHttpRequest.withCredentials parameter #43

Open
totaldict opened this issue Jan 26, 2024 · 0 comments
Open

Adding support XMLHttpRequest.withCredentials parameter #43

totaldict opened this issue Jan 26, 2024 · 0 comments

Comments

@totaldict
Copy link

I am making a request where I need to pass the cookies for the current domain to another domain i.e. CORS request. Currently cookies aren't sent when making CORS requests.

The scenario:

I am on https://example.com and I make a request

syncRequest('GET', 'https://api.example.com')

This leads to a 401 unauthorised because the cookie isn't sent.

I believe the underlying request is made using XMLHttpRequest. Some documentation suggests you can include cookies when making CORS requests by setting XMLHttpRequest.withCredentials = true.

Thus, it is necessary to modify the "then-request".

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