-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Ajax with PUT and CORS #4003
Comments
Sorry I'm just getting around to seeing this. It seems like we're just lacking a feature to send a XSRF cookie via headers? That seems like something worth adding, as it's non-trivial for people to reimpliment this over and over. I'll leave this here for when someone gets around to implementing this feature... Here is how Axios does it, as an example seems like it would be straightforward for us to get in. |
I'd like to take a crack at this, probably not over the long weekend but some time in the next week or so. |
@benlesh I have a PR with the general implementation set up. I will get to unit testing it at some point in the next couple days. Let me know if this is what you had in mind 😄 |
…er (#5702) * feat(ajax.ts): send XSRF cookies in a custom header * feat(ajax.ts): update API guardian * feat(ajax.ts): review comments * feat(ajax.ts): fix tests * feat(ajax.ts): better isSameOrigin(). * feat(ajax.ts): use globalThis * feat(ajax.ts): rm unused fn * feat(ajax.ts): add tests and use config.crossDomain * feat(ajax.ts): fix in Node 11 * feat(ajax.ts): rm globalThis * feat(ajax.ts): fix globalThis in tests * feat(ajax.ts): rm incorrect import * feat(ajax.ts): update api_guardian * feat(ajax.ts): delete readCookie * feat(ajax.ts): update api_guard * feat(ajax.ts): checkout master on unrelated files closes #4003
Bug Report
Current Behavior
Ajax PUT is not sending the cookie in the header.
Reproduction
Expected behavior
When exchanging "PUT" with "POST" a cookie is sent. PUT should behave the same way.
Environment
Additional context/Screenshots
I'm not sure if I'm doing something incorrectly here, but when using "POST" everything works as expected. A cookie is sent and I can use my IP. But when using "PUT" I can see that the header does not include any cookie. Any help is appreciated!
The text was updated successfully, but these errors were encountered: