@void/edge 1.1.11 → 1.1.12

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.
package/dist/index.d.mts CHANGED
@@ -188,10 +188,9 @@ type ResolvedAsset = Readonly<{
188
188
  spa?: boolean;
189
189
  }>;
190
190
  /**
191
- * Percent-decode a request pathname for a manifest lookup, honoring ONLY the
192
- * encodings a conformant URL is required to use. Returns the raw value
193
- * unchanged on a malformed sequence (e.g. a lone `%`) or on any non-canonical /
194
- * over-encoded spelling.
191
+ * Percent-decode a request pathname for a manifest lookup, honoring required
192
+ * URL encodings and encoded square brackets. Returns the raw value unchanged
193
+ * on a malformed sequence (e.g. a lone `%`) or other over-encoded spellings.
195
194
  *
196
195
  * Request pathnames arrive percent-encoded — WHATWG `URL.pathname` never
197
196
  * decodes — but manifest keys are the asset's decoded on-disk path (a file
@@ -199,8 +198,10 @@ type ResolvedAsset = Readonly<{
199
198
  * `%20`). Callers try the raw key first, then this decoded form.
200
199
  *
201
200
  * The decoded form is accepted only when re-encoding it reproduces the request
202
- * path (up to percent-escape letter case) — i.e. the only encoded bytes were
203
- * characters a URL MUST encode (space, `#`, non-ASCII, …). This rejects
201
+ * path (up to percent-escape letter case and square-bracket encoding). Next.js
202
+ * encodes brackets in dynamic-page chunk URLs even though URL.pathname leaves
203
+ * them literal. Other accepted escapes are characters a URL MUST encode
204
+ * (space, `#`, non-ASCII, …). This rejects
204
205
  * over-encoded spellings of ordinary path text (`%2F`→`/`, `%61`→`a`, `%5F`→`_`,
205
206
  * `%2e%2e`→`..`), which a browser would never send and which would otherwise let
206
207
  * a request reconstruct a guarded path (`/assets%2Fx`, `/%61ssets/x`,
package/dist/index.mjs CHANGED
@@ -602,10 +602,9 @@ function rewriteRequest(request, url, originalUrl) {
602
602
  //#endregion
603
603
  //#region src/static.ts
604
604
  /**
605
- * Percent-decode a request pathname for a manifest lookup, honoring ONLY the
606
- * encodings a conformant URL is required to use. Returns the raw value
607
- * unchanged on a malformed sequence (e.g. a lone `%`) or on any non-canonical /
608
- * over-encoded spelling.
605
+ * Percent-decode a request pathname for a manifest lookup, honoring required
606
+ * URL encodings and encoded square brackets. Returns the raw value unchanged
607
+ * on a malformed sequence (e.g. a lone `%`) or other over-encoded spellings.
609
608
  *
610
609
  * Request pathnames arrive percent-encoded — WHATWG `URL.pathname` never
611
610
  * decodes — but manifest keys are the asset's decoded on-disk path (a file
@@ -613,8 +612,10 @@ function rewriteRequest(request, url, originalUrl) {
613
612
  * `%20`). Callers try the raw key first, then this decoded form.
614
613
  *
615
614
  * The decoded form is accepted only when re-encoding it reproduces the request
616
- * path (up to percent-escape letter case) — i.e. the only encoded bytes were
617
- * characters a URL MUST encode (space, `#`, non-ASCII, …). This rejects
615
+ * path (up to percent-escape letter case and square-bracket encoding). Next.js
616
+ * encodes brackets in dynamic-page chunk URLs even though URL.pathname leaves
617
+ * them literal. Other accepted escapes are characters a URL MUST encode
618
+ * (space, `#`, non-ASCII, …). This rejects
618
619
  * over-encoded spellings of ordinary path text (`%2F`→`/`, `%61`→`a`, `%5F`→`_`,
619
620
  * `%2e%2e`→`..`), which a browser would never send and which would otherwise let
620
621
  * a request reconstruct a guarded path (`/assets%2Fx`, `/%61ssets/x`,
@@ -638,7 +639,8 @@ function safeDecodePathname(pathname) {
638
639
  if (decoded === pathname) return pathname;
639
640
  const canonical = reencodePathname(decoded);
640
641
  if (canonical === null) return pathname;
641
- return normalizePercentCase(canonical) === normalizePercentCase(pathname) ? decoded : pathname;
642
+ const normalized = normalizePercentCase(pathname).replace(/%5B/g, "[").replace(/%5D/g, "]");
643
+ return normalizePercentCase(canonical) === normalized ? decoded : pathname;
642
644
  }
643
645
  /** Uppercase the hex digits of every `%xx` escape so encodings compare equal
644
646
  * regardless of the letter case a client used. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@void/edge",
3
- "version": "1.1.11",
3
+ "version": "1.1.12",
4
4
  "description": "Routing, headers, and static asset helpers for Void runtimes.",
5
5
  "homepage": "https://void.cloud",
6
6
  "bugs": {
@@ -26,7 +26,7 @@
26
26
  "access": "public"
27
27
  },
28
28
  "dependencies": {
29
- "@void/deploy-core": "1.1.11"
29
+ "@void/deploy-core": "1.1.12"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@cloudflare/workers-types": "^5.20261014.1",