diff --git a/apps/client-standalone/src/lightweight/browser_routes.ts b/apps/client-standalone/src/lightweight/browser_routes.ts index 739fae625e..c60d9f7ddd 100644 --- a/apps/client-standalone/src/lightweight/browser_routes.ts +++ b/apps/client-standalone/src/lightweight/browser_routes.ts @@ -166,6 +166,7 @@ function createAsyncRoute(router: BrowserRouter) { * Used for route handlers (like image routes) that write directly to the response. */ function createMockExpressResponse() { + const chunks: string[] = []; const res = { _used: false, _status: 200, @@ -192,6 +193,15 @@ function createMockExpressResponse() { res._used = true; res._status = code; return res; + }, + write(chunk: string) { + chunks.push(chunk); + return true; + }, + end() { + res._used = true; + res._body = chunks.join(""); + return res; } }; return res;