This commit is contained in:
Rizky 2024-02-07 17:45:14 +07:00
parent 51c8eacad5
commit 020fb04fc5
1 changed files with 11 additions and 3 deletions

View File

@ -64,9 +64,17 @@ export const fetchViaProxy = async (
return raw; return raw;
} }
} else { } else {
if (body instanceof File) { if (
const res = await fetch(url, { body, headers: _headers }); data instanceof File ||
return await res.text(); (Array.isArray(data) && data[0] instanceof File)
) {
if (data instanceof File) {
const res = await fetch(url, { body: data, headers: _headers });
return await res.text();
} else {
const res = await fetch(url, { body: data[0], headers: _headers });
return await res.text();
}
} else { } else {
const res = await fetch(`${w.basehost ? w.basehost : ""}/_proxy`, { const res = await fetch(`${w.basehost ? w.basehost : ""}/_proxy`, {
method: "POST", method: "POST",