From 7daf7cf695740157b5b25c77db9f6d782a0d8b2c Mon Sep 17 00:00:00 2001 From: Kenneth Skovhus Date: Fri, 19 Oct 2018 12:52:57 +0200 Subject: [PATCH] Make withCredentials writable (#47) Fixes https://github.com/ykzts/node-xmlhttprequest/issues/39 See https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials --- lib/xmlhttprequest.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/xmlhttprequest.js b/lib/xmlhttprequest.js index 2b86a49..ba631bb 100644 --- a/lib/xmlhttprequest.js +++ b/lib/xmlhttprequest.js @@ -440,9 +440,10 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget { upload: Object.assign({}, OVERRIDE_PROTECTION_DESCRIPTOR, { value: null }), - withCredentials: Object.assign({}, OVERRIDE_PROTECTION_DESCRIPTOR, { - value: false - }) + withCredentials: { + value: false, + writable: true + } }; Object.defineProperties(XMLHttpRequest, xmlHttpRequestConstants); Object.defineProperties(XMLHttpRequest.prototype, Object.assign(