From b11814dbde44a02ff840d29ed03087a3a765e6e6 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Thu, 22 Sep 2022 17:36:37 +0200 Subject: [PATCH] [spidermonkey] Implemented setter for withCredentials. Not fully --- src/ecmascript/spidermonkey/xhr.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ecmascript/spidermonkey/xhr.cpp b/src/ecmascript/spidermonkey/xhr.cpp index 020d79d7..87d44467 100644 --- a/src/ecmascript/spidermonkey/xhr.cpp +++ b/src/ecmascript/spidermonkey/xhr.cpp @@ -1231,7 +1231,16 @@ xhr_set_property_withCredentials(JSContext *ctx, unsigned int argc, JS::Value *v if (!xhr) { return false; } + + if (xhr->readyState != UNSENT && xhr->readyState != OPENED) { + return false; + } + + if (xhr->isSend) { + return false; + } xhr->withCredentials = args[0].toBoolean(); + /// TODO Set this’s cross-origin credentials to the given value. return true; }