fix: prevent native fetch error
Fix "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type undefined" error
This commit is contained in:
@@ -1974,7 +1974,7 @@ export async function fetchNative(url:string, arg:{
|
|||||||
id: fetchId,
|
id: fetchId,
|
||||||
url: url,
|
url: url,
|
||||||
headers: JSON.stringify(headers),
|
headers: JSON.stringify(headers),
|
||||||
body: Buffer.from(realBody).toString('base64'),
|
body: realBody ? Buffer.from(realBody).toString('base64') : '',
|
||||||
method: arg.method
|
method: arg.method
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
try {
|
try {
|
||||||
@@ -1994,7 +1994,7 @@ export async function fetchNative(url:string, arg:{
|
|||||||
id: fetchId,
|
id: fetchId,
|
||||||
url: url,
|
url: url,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
body: Buffer.from(realBody).toString('base64'),
|
body: realBody ? Buffer.from(realBody).toString('base64') : '',
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if(!res.success){
|
if(!res.success){
|
||||||
error = res.error
|
error = res.error
|
||||||
|
|||||||
Reference in New Issue
Block a user