Skip to content

High performance self-hosted photo and video management solution.

fix(cli): prevent out-of-memory on file upload due to undici storing the request body (#28723)

moversityafa836181c2e
diff --git a/packages/cli/src/commands/asset.ts b/packages/cli/src/commands/asset.ts
index 2c6430c83a..b0a9037289 100644
--- a/packages/cli/src/commands/asset.ts
+++ b/packages/cli/src/commands/asset.ts
@@ -426,6 +426,8 @@ const uploadFile = async (input: string, stats: Stats): Promise<AssetMediaRespon
redirect: 'error',
headers: headers as Record<string, string>,
body: formData,
+ // eslint-disable-next-line unicorn/no-null
+ window: null,
});
if (response.status !== 200 && response.status !== 201) {
throw new Error(await response.text());