1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-02-02 15:09:23 -05:00

[quickjs] Fix in xhr (absolute paths)

This commit is contained in:
Witold Filipczyk 2024-11-01 13:20:16 +01:00
parent fcb4268085
commit e2d0fe1d5a
2 changed files with 12 additions and 1 deletions

View File

@ -567,7 +567,6 @@ process_xhr_headers(char *head, struct Xhr *x)
next = next2 + 1;
next2 = strchr(next, '\n');
}
next = next2 + 1;
size = explode(line, ':', &header, &value);
if (size == 0) {

View File

@ -1072,6 +1072,18 @@ xhr_open(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
}
char *url = straconcat(ref, "/", x->responseURL, NULL);
if (url) {
x->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, x->responseURL, NULL);
if (url) {
x->uri = get_uri(url, URI_NONE);
mem_free(url);