fix js fetch headers (##589)

This commit is contained in:
wanghongenpin
2025-09-12 00:36:22 +08:00
parent 22eb6a70eb
commit 07ffeb8e0f
5 changed files with 42 additions and 9 deletions

20
test/js.js Normal file
View File

@@ -0,0 +1,20 @@
async function onRequest() {
const fetchResponse = await fetch('https://httpbin.org/anything');
console.log(fetchResponse.headers);
console.log(await fetchResponse.text());
console.log( fetchResponse.body);
const response = {
statusCode: 200,
body: fetchResponse.body,
headers: fetchResponse.headers
};
return response;
}
onRequest().then( response => {
console.log('Response:', response);
})