fix proxy

This commit is contained in:
Rizky 2024-02-07 17:13:30 +07:00
parent c3b519382b
commit b09800f152
1 changed files with 30 additions and 25 deletions

View File

@ -63,6 +63,10 @@ export const fetchViaProxy = async (
} catch (e) { } catch (e) {
return raw; return raw;
} }
} else {
if (body instanceof File) {
const res = await fetch(url, { body, 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",
@ -94,4 +98,5 @@ export const fetchViaProxy = async (
return text; return text;
} }
} }
}
}; };