Commit 91674b2c authored by Andy Wilkinson's avatar Andy Wilkinson

Don’t use Java 7 API in EmbeddedMongoAutoConfiguration

Closes gh-4630
parent c58ebae4
......@@ -157,7 +157,9 @@ public class EmbeddedMongoAutoConfiguration {
private InetAddress getHost() throws UnknownHostException {
if (this.properties.getHost() == null) {
return InetAddress.getLoopbackAddress();
return InetAddress.getByAddress(Network.localhostIsIPv6()
? new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }
: new byte[] { 127, 0, 0, 1 });
}
return InetAddress.getByName(this.properties.getHost());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment