Fix hostname parsing in java.net.URLStreamHandler.

As per https://url.spec.whatwg.org/#host-state, any of the
characters '/', '\', '#' or '?' should be treated as
terminators when parsing the host part of a URL.

Change-Id: I1dc8db7101fdd863b51408b9cfb3ef7a585f1c04
Tested: Ran CtsLibcoreTestCases
Bug: 110955991
(cherry picked from commit 512b127b593c9bdfbd92e2744495d9e17be9b4f3)
2 files changed