From 8395d2ab633d09762dca44b2d5cad9fc18c7910d Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Wed, 19 Nov 2025 14:57:32 +0100 Subject: [PATCH] Propagate errors (e.g. when disabled) for proxy fetch --- client/space_lua/stdlib/net.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/space_lua/stdlib/net.ts b/client/space_lua/stdlib/net.ts index 58ef8fb5..d79de4e8 100644 --- a/client/space_lua/stdlib/net.ts +++ b/client/space_lua/stdlib/net.ts @@ -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 ||