Commit be5d4a5
committed
Harden SmithyUri validation correctness
- Fix authority/path join bug in buildString() that produced invalid URIs
like "https://example.comfoo" when path lacked leading slash
- Add userInfo as a first-class field with getter, wither, and factory
- Store IPv6 hosts unbracketed internally, bracket only in toString()
- Normalize scheme and host to lowercase (of(URI) normalizes, component
APIs reject uppercase)
- Replace path/query/userInfo char denylist with RFC 3986 allowlists
- Replace branching char validation with boolean[128] lookup tables
- Fix withPath(null) returning new instance when path already empty
- Fix hashCode() recomputing when actual hash is zero
- Add equals() identity fast path
- Reject opaque URIs and registry-based authorities in of(URI)
- Reject IPv6 zone identifiers and bare brackets in host
- Remove cached URI string from of(URI) to avoid inconsistency with
normalized fields1 parent 9f25944 commit be5d4a5
2 files changed
Lines changed: 467 additions & 69 deletions
File tree
- io/src
- main/java/software/amazon/smithy/java/io/uri
- test/java/software/amazon/smithy/java/io/uri
0 commit comments