wip fix
This commit is contained in:
parent
277dc28703
commit
6f93fe2cc7
|
|
@ -68,15 +68,16 @@ export const fetchViaProxy = async (
|
||||||
data instanceof File ||
|
data instanceof File ||
|
||||||
(Array.isArray(data) && data[0] instanceof File)
|
(Array.isArray(data) && data[0] instanceof File)
|
||||||
) {
|
) {
|
||||||
|
const target = new URL(url);
|
||||||
if (data instanceof File) {
|
if (data instanceof File) {
|
||||||
const res = await fetch(url, {
|
const res = await fetch(target.pathname, {
|
||||||
body: data,
|
body: data,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: _headers,
|
headers: _headers,
|
||||||
});
|
});
|
||||||
return await res.text();
|
return await res.text();
|
||||||
} else {
|
} else {
|
||||||
const res = await fetch(url, {
|
const res = await fetch(target.pathname, {
|
||||||
body: data[0],
|
body: data[0],
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: _headers,
|
headers: _headers,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue