Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Fix tar upload content-length mismatch (#1089) (#1095)

Mish Ushakov1c5cf950b6fa
diff --git a/.changeset/twelve-cities-tell.md b/.changeset/twelve-cities-tell.md
new file mode 100644
index 000000000..eda48430e
--- /dev/null
+++ b/.changeset/twelve-cities-tell.md
@@ -0,0 +1,5 @@
+---
+'e2b': patch
+---
+
+Use portable mode for deterministic gzip output
diff --git a/packages/js-sdk/src/template/utils.ts b/packages/js-sdk/src/template/utils.ts
index d1224b978..0a2c70624 100644
--- a/packages/js-sdk/src/template/utils.ts
+++ b/packages/js-sdk/src/template/utils.ts
@@ -278,9 +278,10 @@ export async function tarFileStream(
const filePaths = allFiles.map((file) => file.relativePosix())
+ // gzip.portable ensures deterministic gzip header without affecting file modes
return create(
{
- gzip: true,
+ gzip: { portable: true },
cwd: fileContextPath,
follow: resolveSymlinks,
noDirRecurse: true,