diff --git a/src/ecmascript/mujs/xhr.c b/src/ecmascript/mujs/xhr.c index 3907230a..21cacbae 100644 --- a/src/ecmascript/mujs/xhr.c +++ b/src/ecmascript/mujs/xhr.c @@ -416,7 +416,7 @@ mjs_xhr_open(js_State *J) return; } - if (!strchr(xhr->responseURL, '/')) { + if (xhr->responseURL[0] != '/') { char *ref = get_uri_string(vs->uri, URI_DIR_LOCATION | URI_PATH); if (ref) { diff --git a/src/ecmascript/quickjs/xhr.c b/src/ecmascript/quickjs/xhr.c index 37222233..967699f6 100644 --- a/src/ecmascript/quickjs/xhr.c +++ b/src/ecmascript/quickjs/xhr.c @@ -1058,7 +1058,7 @@ xhr_open(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv) struct ecmascript_interpreter *interpreter = (struct ecmascript_interpreter *)JS_GetContextOpaque(ctx); struct view_state *vs = interpreter->vs; - if (!strchr(x->responseURL, '/')) { + if (x->responseURL[0] != '/') { char *ref = get_uri_string(vs->uri, URI_DIR_LOCATION | URI_PATH); if (ref) { diff --git a/src/ecmascript/spidermonkey/xhr.cpp b/src/ecmascript/spidermonkey/xhr.cpp index 28e0359f..0505e4fc 100644 --- a/src/ecmascript/spidermonkey/xhr.cpp +++ b/src/ecmascript/spidermonkey/xhr.cpp @@ -608,7 +608,7 @@ xhr_open(JSContext *ctx, unsigned int argc, JS::Value *rval) return false; } - if (!strchr(xhr->responseURL, '/')) { + if (xhr->responseURL[0] != '/') { char *ref = get_uri_string(vs->uri, URI_DIR_LOCATION | URI_PATH); if (ref) {