fixup 259f3732: only switch to POST if 'body' wasn't customized

This commit is contained in:
tophf 2018-03-12 22:39:19 +03:00
parent 6c62b9feac
commit 34799263eb

View File

@ -462,7 +462,7 @@ function sessionStorageHash(name) {
*/ */
function download(url, { function download(url, {
method = 'GET', method = 'GET',
body = null, body,
responseType = 'text', responseType = 'text',
requiredStatusCode = 200, requiredStatusCode = 200,
timeout = 10e3, timeout = 10e3,
@ -471,7 +471,7 @@ function download(url, {
}, },
} = {}) { } = {}) {
const queryPos = url.indexOf('?'); const queryPos = url.indexOf('?');
if (queryPos > 0) { if (queryPos > 0 && body === undefined) {
method = 'POST'; method = 'POST';
body = url.slice(queryPos); body = url.slice(queryPos);
url = url.slice(0, queryPos); url = url.slice(0, queryPos);