From 512c85bbcbc1b0e25955f63d7fbea47dc26e663d Mon Sep 17 00:00:00 2001 From: nguyeho7 Date: Thu, 27 Mar 2025 11:11:43 -0700 Subject: [PATCH] Add support for application/xml content type in lua http.request (#1320) Co-authored-by: Long Hoang Nguyen --- web/syscalls/fetch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/syscalls/fetch.ts b/web/syscalls/fetch.ts index 94b4a7e0..2afcbb79 100644 --- a/web/syscalls/fetch.ts +++ b/web/syscalls/fetch.ts @@ -49,7 +49,7 @@ export function sandboxFetchSyscalls( let body: any; if (resp.headers.get("Content-Type")?.startsWith("application/json")) { body = await resp.json(); - } else if (resp.headers.get("Content-Type")?.startsWith("text/")) { + } else if (resp.headers.get("Content-Type")?.startsWith("application/xml") || resp.headers.get("Content-Type")?.startsWith("text/")) { body = await resp.text(); } else { body = new Uint8Array(await resp.arrayBuffer());