Update URLConnection#testLenientUrlToUriNul.

Our earlier behaviour was somewhat broken. We'd accept
hosts with \u0000 in them, and then produce a request with
a bad Host header. We now fail on such requests, so add a
unit test to exercise that new behaviour.

The ideal behaviour might be to be lenient and escape characters
that we don't like. (This would involve using the URI from
URL#toUriLenient to populate the Host header. I attempted that
but it has the side effect of introducing a new set of
incompatibilities).

(cherry picked from aafc934e9e3b5afce7c54162654720fad80)

bug: 10211309

Change-Id: I38a0d39124dc5ca766a6e963e72b0250440e82ee
1 file changed