h3-nightly 3.0.0-20251021-151501-4247682 → 3.0.0-20251021-175148-5911ecb

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.
Files changed (2) hide show
  1. package/dist/h3.mjs +17 -3
  2. package/package.json +1 -1
package/dist/h3.mjs CHANGED
@@ -360,8 +360,22 @@ function mergeHeaders$1(base, overrides, target = new Headers(base)) {
360
360
  else target.set(name, value);
361
361
  return target;
362
362
  }
363
- const emptyHeaders = /* @__PURE__ */ new Headers({ "content-length": "0" });
364
- const jsonHeaders = /* @__PURE__ */ new Headers({ "content-type": "application/json;charset=UTF-8" });
363
+ const ERROR_FROZEN = () => {
364
+ throw new Error("Headers are frozen");
365
+ };
366
+ var FrozenHeaders = class extends Headers {
367
+ set() {
368
+ ERROR_FROZEN();
369
+ }
370
+ append() {
371
+ ERROR_FROZEN();
372
+ }
373
+ delete() {
374
+ ERROR_FROZEN();
375
+ }
376
+ };
377
+ const emptyHeaders = /* @__PURE__ */ new FrozenHeaders({ "content-length": "0" });
378
+ const jsonHeaders = /* @__PURE__ */ new FrozenHeaders({ "content-type": "application/json;charset=UTF-8" });
365
379
  function prepareResponseBody(val, event, config) {
366
380
  if (val === null || val === void 0) return {
367
381
  body: "",
@@ -411,7 +425,7 @@ function errorResponse(error, debug) {
411
425
  }, void 0, debug ? 2 : void 0), {
412
426
  status: error.status,
413
427
  statusText: error.statusText,
414
- headers: error.headers ? mergeHeaders$1(jsonHeaders, error.headers) : jsonHeaders
428
+ headers: error.headers ? mergeHeaders$1(jsonHeaders, error.headers) : new Headers(jsonHeaders)
415
429
  });
416
430
  }
417
431
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "h3-nightly",
3
- "version": "3.0.0-20251021-151501-4247682",
3
+ "version": "3.0.0-20251021-175148-5911ecb",
4
4
  "description": "Minimal H(TTP) framework built for high performance and portability.",
5
5
  "homepage": "https://h3.dev",
6
6
  "repository": "h3js/h3",