mirror of
https://github.com/rkd77/elinks.git
synced 2025-06-30 22:19:29 -04:00
[uri] Do not return earlier. Check also POST
This commit is contained in:
parent
03d7311cec
commit
8c2f1092f6
@ -685,6 +685,17 @@ xhr_send(JSContext *ctx, unsigned int argc, JS::Value *rval)
|
|||||||
|
|
||||||
if (xhr->method == POST && argc == 1) {
|
if (xhr->method == POST && argc == 1) {
|
||||||
body = jsval_to_string(ctx, args[0]);
|
body = jsval_to_string(ctx, args[0]);
|
||||||
|
xhr->uri->post = body;
|
||||||
|
char *url2 = get_uri_string(xhr->uri, URI_DIR_LOCATION | URI_PATH | URI_USER | URI_PASSWORD | URI_POST);
|
||||||
|
|
||||||
|
if (!url2) {
|
||||||
|
mem_free(body);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
done_uri(xhr->uri);
|
||||||
|
xhr->uri = get_uri(url2, URI_DIR_LOCATION | URI_PATH | URI_USER | URI_PASSWORD | URI_POST);
|
||||||
|
mem_free(url2);
|
||||||
|
mem_free(body);
|
||||||
}
|
}
|
||||||
xhr->download.data = xhr;
|
xhr->download.data = xhr;
|
||||||
xhr->download.callback = (download_callback_T *)xhr_loading_callback;
|
xhr->download.callback = (download_callback_T *)xhr_loading_callback;
|
||||||
|
@ -618,7 +618,7 @@ add_uri_to_string(struct string *string, const struct uri *uri,
|
|||||||
add_char_to_string(string, '/');
|
add_char_to_string(string, '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!uri->datalen) return string;
|
if (uri->datalen) {
|
||||||
|
|
||||||
if (uri->protocol == PROTOCOL_DATA) {
|
if (uri->protocol == PROTOCOL_DATA) {
|
||||||
char *e;
|
char *e;
|
||||||
@ -636,7 +636,8 @@ add_uri_to_string(struct string *string, const struct uri *uri,
|
|||||||
if (wants(URI_FILENAME) && is_uri_dir_sep(uri, *pos))
|
if (wants(URI_FILENAME) && is_uri_dir_sep(uri, *pos))
|
||||||
filename = pos + 1;
|
filename = pos + 1;
|
||||||
|
|
||||||
return add_bytes_to_string(string, filename, pos - filename);
|
add_bytes_to_string(string, filename, pos - filename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wants(URI_QUERY) && uri->datalen) {
|
if (wants(URI_QUERY) && uri->datalen) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user