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

RxJs 7 setting X-Requested-With by default when RxJs 6 did not #6827

Open
driskell opened this issue Feb 13, 2022 · 5 comments
Open

RxJs 7 setting X-Requested-With by default when RxJs 6 did not #6827

driskell opened this issue Feb 13, 2022 · 5 comments

Comments

@driskell
Copy link

driskell commented Feb 13, 2022

Describe the bug

Reraise of #6663

The X-Requested-With header is still getting set in v7 with default parameters to an AJAX call where with RxJs 6 it did not, constituting a breaking change when using with a server that does not support preflight requests but does correctly return an Access-Control-Allow-Origin.

I've enhanced the reproductions to try show it more clearly in the codepen.

Expected behavior

Default parameter AJAX call to a non-same-origin endpoint which does not support Preflight but does return the correct allow headers to succeed. In other words - do not send a custom header in the request.

Reproduction code

Working:
6.6.7: https://codepen.io/Driskell/pen/yLovOxK

Not working:
7.4.0: https://codepen.io/Driskell/pen/MWvQymO
7.5.2: https://codepen.io/Driskell/pen/PoJyRaz
7.5.4: https://codepen.io/Driskell/pen/jOaGbwX
7.5.6: https://codepen.io/Driskell/pen/poVyyLo
8.0.0-alpha.4: https://codepen.io/Driskell/pen/NWMNNYV

Reproduction URL

No response

Version

7.5.2

Environment

No response

Additional context

No response

@driskell
Copy link
Author

I can see the last issue did cause some changes and it seems things are improved but I'm still getting lots of issues around this as it's still unexpected for X-Requested-With to get appended by default.

@driskell
Copy link
Author

Was anyone able to examine this?

@driskell
Copy link
Author

Hit this again with CORS as there's now an additional header in Access-Control-Request-Headers 😢

@driskell
Copy link
Author

driskell commented Sep 9, 2022

Still seeing the rogue header in latest 7 and the new 8 alpha

7.5.6: https://codepen.io/Driskell/pen/poVyyLo
8.0.0-alpha.4: https://codepen.io/Driskell/pen/NWMNNYV

@driskell
Copy link
Author

driskell commented Sep 9, 2022

@benlesh Did you have any thoughts on the above?

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