Propagate errors (e.g. when disabled) for proxy fetch

This commit is contained in:
Zef Hemel
2025-11-19 14:57:32 +01:00
parent b0f6b9a33d
commit 8395d2ab63
+8
View File
@@ -31,6 +31,14 @@ export const netApi = new LuaTable({
buildProxyUrl(client, url),
fetchOptions,
);
if (resp.status !== 200) {
return {
ok: false,
status: resp.status,
headers: extractProxyHeaders(resp.headers),
body: await resp.text(),
};
}
// Do sensible things with the body based on the content type
let body: any;
const contentTypeHeader = options.responseEncoding ||