0
0
mirror of https://github.com/rkd77/elinks.git synced 2025-06-30 22:19:29 -04:00

[spidermonkey] Check async=false and timeout or responseType.

This commit is contained in:
Witold Filipczyk 2022-09-21 20:55:13 +02:00
parent 924b494ba6
commit 1cb4df952c

View File

@ -363,10 +363,7 @@ xhr_open(JSContext *ctx, unsigned int argc, JS::Value *rval)
if (argc > 4) {
password = jsval_to_string(ctx, args[4]);
}
if (!username && !password) {
args.rval().setUndefined();
return true;
}
if (username || password) {
if (username) {
xhr->uri->user = username;
xhr->uri->userlen = strlen(username);
@ -385,6 +382,10 @@ xhr_open(JSContext *ctx, unsigned int argc, JS::Value *rval)
done_uri(xhr->uri);
xhr->uri = get_uri(url2, URI_DIR_LOCATION | URI_PATH | URI_USER | URI_PASSWORD);
mem_free(url2);
}
if (!xhr->async && (xhr->timeout || (xhr->responseType && *(xhr->responseType)))) {
return false;
}
args.rval().setUndefined();