Parse precisely · normalize intentionally
A URL can keep its meaning while changing its bytes.
Browsers parse, normalize, encode, and serialize. That is useful—until a cache key, signature, duplicate parameter, or audit log depends on the spelling you started with.
https://User:pa%24%24@例子.test:8443/a%2Fb/c%20d?tag=red+shoes&tag=web#Top%2FSectionhttps://User:pa%24%[email protected]:8443/a%2Fb/c%20d?tag=red+shoes&tag=web#Top%2FSectionHostname normalization is visible. Credentials, query order, and escaped path separators deserve review before reuse.
URL anatomy rail
Each delimiter changes the parser state.
https:Security and default-port context
User:••••@Frequently logged or leaked
xn--fsqu00a.testIDN serializes as ASCII
8443Non-default origin member
/a%2Fb/c%20d%2F stays inside a segment
?tag=…&tag=…Ordered key/value pairs
#Top%2FSectionClient-side; not sent in HTTP requests
Query as ordered multimap
Duplicate keys are first-class data.
Object conversion would overwrite tag=red shoes with tag=web. URLSearchParams keeps both pairs in order.
tagred shoesplus decoded as a spacetagwebsame key, second valueempty∅empty valueflag∅key-only spelling normalizesnext/billing?step=2nested URL valueEncoding courtroom
The same glyph can carry different protocol meaning.
red shoesred%20shoesred+shoes in form-style query data
C++C%2B%2BA raw + may decode as space
a/ba%2FbEscaped slash stays inside one segment
例子.testxn--fsqu00a.testIDNA hostname serialization
50%50%25Double encoding would create %2525
Secret-bearing URL triage
Readable does not mean safe to log.
Credentials
HIGHStrip userinfo before sharing or logging.
Access token query
HIGHPrefer headers; query strings spread through logs and history.
Signed parameters
BYTE-SENSITIVENormalization or reordering can invalidate a signature.
Fragment data
CLIENT-SIDENot sent in HTTP, but can still leak through copied links and scripts.
Rebuild diff
Inspect the bytes created by one logical edit.
Only the final byte changed here. Re-run the comparison after sorting, decoding, IDN normalization, or component edits.
?tag=red+shoes&tag=web&next=%2Fbilling%3Fstep%3D2?tag=red+shoes&tag=web&next=%2Fbilling%3Fstep%3D3