Prerequisites
Description
userinfo part is being automatically percent-decoded, so that both 'A%3AB' and 'A:B' end up being decoded as 'a:b' - while the former means (user "A:B") and the later (user "A" with password "B").
The spec itself uses this production:
userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
which means that : definitely is a special character, and should be treated specially here. They even treat it specially later:
Applications should not render as clear text any data after the first colon (":") character found within a userinfo subcomponent unless the data after the colon is the empty string (indicating no password).
Proposed solutions:
A) do not decode userinfo - just return it as a percent-encoded string
B) return userinfo as an array of :-separated decoded parts (['A:B'] or ['A', 'B'] in this example).
Prerequisites
Description
userinfopart is being automatically percent-decoded, so that both'A%3AB'and'A:B'end up being decoded as'a:b'- while the former means (user "A:B") and the later (user "A" with password "B").The spec itself uses this production:
which means that
:definitely is a special character, and should be treated specially here. They even treat it specially later:Proposed solutions:
A) do not decode
userinfo- just return it as a percent-encoded stringB) return
userinfoas an array of:-separated decoded parts (['A:B']or['A', 'B']in this example).