fix: xhr.withCredentials is initially false
#47
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
According to the XMLHttpRequest2 spec,
xhr.withCredentials
should be initiallyfalse
. http-browserify sets thisflag to
true
by default which disobeys the spec. This leads to browser errors whenmaking CORS requests to domains that have wildcards in their
Access-Control-Allow-Origin header.
http-browserify should attempt to follow the spec by default. In this case,
that means setting
withCredentails
tofalse
initially, and then allowingthe user to override that in the passing in
params
.Maybe it is possible to auto-detect when user credentials
are being sent and then set the
withCredentials
flag from there.Somewhat related to #35 (the committer there expressed concern about
withCredentials
beingtrue
when unintialzed as well).