-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Set request headers to ones provided in transportOpts in XHR transport #2363
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a reasonable addition 👍
Can you please fix the lint errors on CI?
Will do. Probably should have run |
Co-Authored-By: Sijawusz Pur Rahnama <sija@sija.pl>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I noticed, can you please also add this to the FetchTransport to make it feature complete? We use fetch by default if the browser supports it and I assume it will also be helpful there.
No problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome job, thank you! 🥇
Our instance of Sentry is behind a proxy that requires an OAuth bearer token to be passed in the Authorization header. The default XHR transport does not offer a way of easily setting any headers. In my own project, I copied the XHR transport and added a line to set requests. I thought it might be nice to have in the default XHR transport as well.