From 8c88145db623ff2b0c3a63403c80599456b49dd9 Mon Sep 17 00:00:00 2001 From: Luis Camacho Date: Fri, 2 Oct 2020 14:41:25 +0100 Subject: [PATCH] Support 'withCredentials' option to be able to send requests with 'withCredentials' set to true --- src/Request.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Request.js b/src/Request.js index 249d7416f..97d5193f9 100644 --- a/src/Request.js +++ b/src/Request.js @@ -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); @@ -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; } }