Visitar URL original
Comparing v3.1.5...v3.1.7 · fastify/fast-uri · GitHub
Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fastify/fast-uri
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.1.5
Choose a base ref
...
head repository: fastify/fast-uri
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.1.7
Choose a head ref
  • 20 commits
  • 19 files changed
  • 4 contributors

Commits on Aug 22, 2026

  1. fix: encode serialized URI components (#201)

    Backport to 3.x: adapt to pre-normalizeQueryFragmentEncoding codebase by
    adding encodeComponent/encodeQuery/encodeFragment/encodeUserinfo helpers
    directly to lib/utils.js.
    mcollina committed Aug 22, 2026
    Configuration menu
    Copy the full SHA
    989a0af View commit details
    Browse the repository at this point in the history
  2. fix: preserve websocket query delimiters (#202)

    Co-authored-by: Antonio Tripodi <Tony133@users.noreply.github.com>
    mcollina and Tony133 committed Aug 22, 2026
    Configuration menu
    Copy the full SHA
    1b15c7d View commit details
    Browse the repository at this point in the history
  3. fix: validate complete URN input (#203)

    Co-authored-by: Antonio Tripodi <Tony133@users.noreply.github.com>
    mcollina and Tony133 committed Aug 22, 2026
    Configuration menu
    Copy the full SHA
    d44884d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    98541ba View commit details
    Browse the repository at this point in the history
  5. fix: normalize percent-encoding in query and fragment (#183)

    RFC 3986 §6.2.2 case/percent normalization was applied to the path but
    not to the query or fragment:
    
    - the query was passed through verbatim, so `?a=%2a` was not uppercased to
      `?a=%2A`, `%7e`/`%2e` were not decoded, and a raw space or non-ASCII
      byte was left unencoded;
    - the fragment went through `encodeURI(decodeURIComponent(...))`, which
      decodes reserved characters too — `#a%2Fb` became `#a/b`, changing the
      value.
    
    Add `normalizeQueryFragmentEncoding` (the path normalizer with the
    query/fragment character set, which also allows `?` and decodes `.`) and
    route both components through it, so all three are normalized the same way.
    
    A fragment whose decoded bytes are not valid UTF-8 (e.g. `#%E0%A4A`) is
    still valid percent-encoding (RFC 3986 §2.1 is byte-level) and is now
    preserved instead of being flagged as malformed.
    
    Backport to 3.x as a prerequisite for the malformed percent-encoding and
    component serialization hardening fixes.
    mcollina committed Aug 22, 2026
    Configuration menu
    Copy the full SHA
    39792c3 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    96daafe View commit details
    Browse the repository at this point in the history
  7. fix: preserve RFC 3986 path characters and reserved escapes (#209)

    Path serialization used the deprecated escape()-style safe set, which
    rewrote literal reserved path characters into percent escapes (a;b ->
    a%3Bb) and turned existing %3A escapes into live colons (a%3Ab -> a:b)
    via a blanket split('%3A').join(':'). Per RFC 3986 a percent-encoded
    reserved character is not equivalent to its literal form, so both
    rewrites changed route params, matrix params, and cache keys.
    
    Serialize paths against the RFC 3986 path grammar instead: literal
    reserved path characters stay literal and existing percent escapes are
    preserved as data. Path-noscheme handling is retained by escaping only
    literal ':' when no scheme is present.
    
    Closes GHSA-7mh8-fcmq-x23c.
    mcollina committed Aug 22, 2026
    Configuration menu
    Copy the full SHA
    30d175b View commit details
    Browse the repository at this point in the history
  8. fix: preserve URI component case in equality (#207)

    * fix: preserve URI component case in equality
    
    * test: cover malformed object equality
    mcollina committed Aug 22, 2026
    Configuration menu
    Copy the full SHA
    0819d5f View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    4ebffaa View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f1138cf View commit details
    Browse the repository at this point in the history
  11. Merge commit from fork

    mcollina committed Aug 22, 2026
    Configuration menu
    Copy the full SHA
    444ecda View commit details
    Browse the repository at this point in the history
  12. Merge commit from fork

    mcollina committed Aug 22, 2026
    Configuration menu
    Copy the full SHA
    ae92a4c View commit details
    Browse the repository at this point in the history
  13. Merge commit from fork

    * fix: reject malformed IPv6 literals
    
    * fix: restore RFC 5952 zero-run compression for IPv6 hosts
    
    The IPv6 validation rewrite stripped per-hextet leading zeros but no longer
    applied "::" zero-run compression, so normalize() was not RFC 5952 canonical
    and equal() returned false for the same address across expanded and compressed
    forms (e.g. [0:0:0:0:0:0:0:1] did not equal [::1]). That makes equal()-based
    host checks representation-sensitive.
    
    - add compressIPv6ZeroRun (longest run, leftmost on ties, minimum length 2)
    - expand "::" before recompressing so the result is canonical regardless of
      where the input placed "::"
    - add IPv6 canonical/equal tests; update the all-zeros normalize expectation
    
    ---------
    
    Co-authored-by: Ulises Gascon <ulisesgascongonzalez@gmail.com>
    mcollina and UlisesGascon committed Aug 22, 2026
    Configuration menu
    Copy the full SHA
    607bfbe View commit details
    Browse the repository at this point in the history
  14. Merge commit from fork

    mcollina committed Aug 22, 2026
    Configuration menu
    Copy the full SHA
    37f3417 View commit details
    Browse the repository at this point in the history
  15. test: adapt decoded-scheme handler assertion to 3.x (no mailto scheme)

    The mailto scheme handler was added in v4 (#195). Use the existing ws
    scheme to verify the same behavior.
    mcollina committed Aug 22, 2026
    Configuration menu
    Copy the full SHA
    c0f0279 View commit details
    Browse the repository at this point in the history
  16. fix: never run IDN canonicalization on bracketed IP literals

    A bracketed host with a malformed zone identifier (e.g. [fe80::1%25]) is
    not an IP per parse, so canonicalizeHost fell through to the WHATWG
    fallback. Node >= 18 throws there (fail-closed), but Node 16's URL parser
    accepts the input and .hostname strips the brackets, truncating the
    malformed literal. Skip hosts starting with '[' — IDN conversion only
    applies to reg-names.
    mcollina committed Aug 22, 2026
    Configuration menu
    Copy the full SHA
    d941579 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2026

  1. Bumped v3.1.6

    Signed-off-by: Matteo Collina <hello@matteocollina.com>
    mcollina committed Aug 23, 2026
    Configuration menu
    Copy the full SHA
    6f970b2 View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2026

  1. fix: treat unterminated bracket hosts as reg-names again (#214)

    (cherry picked from commit e008152)
    chuanghiduoc authored and mcollina committed Aug 24, 2026
    Configuration menu
    Copy the full SHA
    1eb3ce4 View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2026

  1. fix: backport port and IP-literal validation to v3.x (#216)

    * Merge commit from fork
    
    (cherry picked from commit 820e847)
    
    * Merge commit from fork
    
    (cherry picked from commit 506b155)
    mcollina authored Sep 2, 2026
    Configuration menu
    Copy the full SHA
    9f4c943 View commit details
    Browse the repository at this point in the history
  2. Bumped v3.1.7

    Signed-off-by: Matteo Collina <hello@matteocollina.com>
    mcollina committed Sep 2, 2026
    Configuration menu
    Copy the full SHA
    412e40a View commit details
    Browse the repository at this point in the history
Loading