You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: reject malformed authority and port normalization
* test: add regression tests for encoded authority delimiters in host
Covers %40, %3A, %2F, %23, %3F in host across normalize, parse,
equal, resolve, and serialize. Includes cross-scheme and layered
encoding vectors.
* fix: re-escape gen-delims in host after unescape to prevent authority change
unescape() decodes all percent-encoded characters including reserved
authority delimiters (%40->@, %3A->:, %2F->/, %3F->?, %23->#).
Per RFC 3986 these must stay encoded in the host component.
Adds reescapeHostDelimiters() and applies it at the three call sites
where unescape() is used on the host: parse(), normalizeComponentEncoding(),
and recomposeAuthority().
* refactor: track malformed authority status during parse
* refactor: centralize malformed input handling
---------
Co-authored-by: Ulises Gascon <ulisesgascongonzalez@gmail.com>
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@ Dependency-free RFC 3986 URI toolbox.
12
12
13
13
All of the above functions can accept an additional options argument that is an object that can contain one or more of the following properties:
14
14
15
+
Malformed authorities and out-of-range ports are reported through the parsed component's `error` field. `normalize()` leaves malformed string inputs unchanged, and `equal()` returns `false` when either string input is malformed.
16
+
15
17
*`scheme` (string)
16
18
Indicates the scheme that the URI should be treated as, overriding the URI's normal scheme parsing behavior.
0 commit comments