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);