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:
Kim, Harim
2025-05-20 20:37:43 +09:00
parent d0f254c227
commit a20485c782

View File

@@ -1974,7 +1974,7 @@ export async function fetchNative(url:string, arg:{
id: fetchId,
url: url,
headers: JSON.stringify(headers),
body: Buffer.from(realBody).toString('base64'),
body: realBody ? Buffer.from(realBody).toString('base64') : '',
method: arg.method
}).then((res) => {
try {
@@ -1994,7 +1994,7 @@ export async function fetchNative(url:string, arg:{
id: fetchId,
url: url,
headers: headers,
body: Buffer.from(realBody).toString('base64'),
body: realBody ? Buffer.from(realBody).toString('base64') : '',
}).then((res) => {
if(!res.success){
error = res.error