| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…ments in normalize RFC 3986 Section 6.2.2.2 specifies that percent-encoded unreserved characters should be decoded before applying other normalizations, including dot-segment resolution. The previous order (resolve-then-decode) meant that %2e%2e was not recognized as ".." during path normalization, producing incorrect results like http://example.com/../foo instead of http://example.com/foo.
| Back | FazBrowse Home | New Git URL |
Summary
URL.normalize() resolves dot segments (. and ..) before decoding percent-encoded unreserved characters. Per RFC 3986 Section 6.2.2.2, this order is incorrect -- unreserved characters should be decoded first.
For example, %2e is the percent-encoded form of . (a period is an unreserved character). The path /%2e%2e/foo should be normalized to /foo, but currently it normalizes to /../foo.
Before
After
Test plan
This PR was written under human direction (gaoflow).