Fix authority parsing test
The test has been failing because http://r.android.com/793302 changed how the port separator was found, only scanning ASCII digits until it hits a colon, and previously it would scan for the colon and then percent-decode the rest of it. The new behavior actually better matches the WHATWG URL parsing algorithm [1], which specifies that ports only include ASCII digits. It does mean that some edge cases that previously parsed as host "foo", port 42 will now parse as host "foo:42", no port, but those URLs wouldn't be accepted by browsers so they should be exceedingly rare. The behavior per the WHATWG spec would be to fail to parse in the case of a percent-encoded character in the port section, but this class is specifically documented to accept garbage, so lumping the mis-encoded port as part of the hostname (which will result in a hostname that's invalid and impossible to resolve) seems like the best option. [1] https://url.spec.whatwg.org/#port-state Fixes: 124360078 Test: atest android.net.UriTest Change-Id: I1c788cb7703c821ae74b542b74d89e10cba5a546
Loading
Please register or sign in to comment