Skip to content

Commit

Permalink
Support 'withCredentials' option
Browse files Browse the repository at this point in the history
to be able to send requests with 'withCredentials' set to true
  • Loading branch information
luiscamachopt authored Oct 2, 2020
1 parent 3ec6281 commit 8c88145
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Request.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ function xmlHttpGet (url, params, callback, context) {
if (typeof context !== 'undefined' && context !== null) {
if (typeof context.options !== 'undefined') {
httpRequest.timeout = context.options.timeout;
if (context.options.withCredentials) httpRequest.withCredentials = true;
}
}
httpRequest.send(null);
Expand All @@ -128,6 +129,7 @@ export function request (url, params, callback, context) {
if (typeof context !== 'undefined' && context !== null) {
if (typeof context.options !== 'undefined') {
httpRequest.timeout = context.options.timeout;
if (context.options.withCredentials) httpRequest.withCredentials = true;
}
}

Expand Down

0 comments on commit 8c88145

Please sign in to comment.