@volter/world-core 3.0.157 → 3.0.158

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -146,7 +146,10 @@ async function encoded(m, request, res) {
146
146
  headers.set('content-encoding', 'gzip');
147
147
  headers.delete('content-length');
148
148
  headers.append('vary', 'Accept-Encoding');
149
- return new Response(gzipSync(new Uint8Array(await res.arrayBuffer())), { status: res.status, statusText: res.statusText, headers });
149
+ const body = gzipSync(new Uint8Array(await res.arrayBuffer()));
150
+ // Hold the compressor's buffer with the same finite stream body grammar as decoded(), without copying it.
151
+ const buffered = new ReadableStream({ start(controller) { controller.enqueue(body); controller.close(); } });
152
+ return new Response(buffered, { status: res.status, statusText: res.statusText, headers });
150
153
  }
151
154
  /** A pack's HTTP surface, as the kernel serves it from the pack's parts. */
152
155
  /** A door's path as it is served and listed: under `/_twin/`, whether the manifest writes the prefix or not. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/world-core",
3
- "version": "3.0.157",
3
+ "version": "3.0.158",
4
4
  "description": "The kernel of Volter World: one log per twin, branches as pointers, checkpoints, the fold that keeps a twin current, the head that performs a write against the vendor, references, and the git plane. A twin package builds on it; the runtime serves it.",
5
5
  "keywords": [
6
6
  "twin",
package/src/pack-fetch.ts CHANGED
@@ -211,7 +211,10 @@ async function encoded(m: DerivedManifest, request: Request, res: Response): Pro
211
211
  headers.set('content-encoding', 'gzip');
212
212
  headers.delete('content-length');
213
213
  headers.append('vary', 'Accept-Encoding');
214
- return new Response(gzipSync(new Uint8Array(await res.arrayBuffer())), { status: res.status, statusText: res.statusText, headers });
214
+ const body = gzipSync(new Uint8Array(await res.arrayBuffer()));
215
+ // Hold the compressor's buffer with the same finite stream body grammar as decoded(), without copying it.
216
+ const buffered = new ReadableStream<Uint8Array>({ start(controller) { controller.enqueue(body); controller.close(); } });
217
+ return new Response(buffered, { status: res.status, statusText: res.statusText, headers });
215
218
  }
216
219
 
217
220
  /** A pack's HTTP surface, as the kernel serves it from the pack's parts. */