From fcb426808501312b5743fa0a36e86ad9b7a12c37 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 1 Nov 2024 13:02:22 +0100 Subject: [PATCH] [spidermonkey] fix for absolute urls in xhr --- src/js/spidermonkey/xhr.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/js/spidermonkey/xhr.cpp b/src/js/spidermonkey/xhr.cpp index 6a0160cc6..89ec6011d 100644 --- a/src/js/spidermonkey/xhr.cpp +++ b/src/js/spidermonkey/xhr.cpp @@ -619,6 +619,18 @@ xhr_open(JSContext *ctx, unsigned int argc, JS::Value *rval) } char *url = straconcat(ref, "/", xhr->responseURL, NULL); + if (url) { + xhr->uri = get_uri(url, URI_NONE); + mem_free(url); + } + mem_free(ref); + } + } else { + char *ref = get_uri_string(vs->uri, URI_SERVER); + + if (ref) { + char *url = straconcat(ref, xhr->responseURL, NULL); + if (url) { xhr->uri = get_uri(url, URI_NONE); mem_free(url);