Add support for application/xml content type in lua http.request (#1320)

Co-authored-by: Long Hoang Nguyen <roman_nguyen@gatech.edu>
This commit is contained in:
nguyeho7
2025-03-27 19:11:56 +01:00
committed by Zef Hemel
co-authored by Long Hoang Nguyen
parent 96f299bf8a
commit 512c85bbcb
+1 -1
View File
@@ -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());