-
-
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
Add fetchParameters
to configure fetch
#1177
Add fetchParameters
to configure fetch
#1177
Conversation
This kinda covers #1172 |
Build failure here is a legit, as it relates to the #1149 merge. And it seems its because of the chromium bug, that it does not return correct resourceType. https://bugs.chromium.org/p/chromium/issues/detail?id=765501 |
I'm not very keen to add more and more config options. Especially that we already have Setting sane defaults is totally fine, but I'm not convinced for the rest. @MaxBittker @HazAT what do you think about it guys? |
@kamilogorek headers & fetchParameters are different, as headers can be used for fetch and for XHR. transport is not really friendly, as you have to overwrite the whole logic, and to support that between updates is really hard. XHR already supported auth and passing cookies. When fetch was added initially in another PR, passing parameters should've been implemented as fetch initially is too 'limited' to work out of the box. Which makes it more secure, but limited. As a summary, in the current state, for more sophisticated setups, eg. hosted sentry behind authorization (cookie based), it's not gonna work at all now :( |
@RuslanZavacky I asked @HazAT for an opinion, and we can move forward and merge it. I'll try to release it tomorrow after I make sure that there's nothing left that I could add to the next version :) |
🎉 🎉 🎉 thank you, guys! |
This PR adds the ability to configure fetch
parameters
.Reference: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters
By default, we set
keepalive: true
andcredentials: true
. Keepalive should help to send request even on unload and credentials will pass cookies to the request. Passing cookies are essentials for self-hosted solutions if they are behind authorization that requires cookies (our use case).Added
referrerPolicy: 'origin'
as well, as sentry requires referer header to be passed. Without this option it won't work, so making it default seems like a good idea.