[RFR]: 8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
Daniel Fuchs
daniel.fuchs at oracle.com
Tue Mar 26 17:23:35 UTC 2019
Hi Arthur,
On 26/03/2019 16:51, Arthur Eubanks wrote:
> Changed B6890349.java to use URL constructor.
> Changed sequence of URIBuilder calls to `.host().port().path()`.
> Added missing `.path("/")`.
> Added logging for most of the constructed URLs.
>
> PTAL:
> http://cr.openjdk.java.net/~aeubanks/8220575/webrev.01/test/jdk/com/sun/net/httpserver/bugs/B6373555.java.udiff.html
Looks good! Thanks for doing that.
> I was considering adding a buildURL() to URIBuilder since so many of
> these URIs end up getting converted to a URL in the end. Not sure if
> that's a good idea or not.
Your call. If you do then maybe we should be considering adding:
public URIBuilder loopback() {
return host(InetAddress.getLoopbackAddress().getHostAddress());
}
and I can't say I like URIBuilder::buildURL much - maybe
URIBuilder::toURL would be a better name in that case?
best regards,
-- daniel
More information about the net-dev
mailing list