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:
committed by
Zef Hemel
co-authored by
Long Hoang Nguyen
parent
96f299bf8a
commit
512c85bbcb
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user