--- a/src/java.management.rest/share/classes/javax/management/remote/rest/PlatformRestAdapter.java Tue Jan 02 13:33:08 2018 +0530
+++ b/src/java.management.rest/share/classes/javax/management/remote/rest/PlatformRestAdapter.java Tue Jan 02 15:03:52 2018 +0530
@@ -271,9 +271,9 @@
}
try {
if (httpServer instanceof HttpsServer) {
- return "https://" + InetAddress.getLocalHost().getHostName() + ":" + httpServer.getAddress().getPort();
+ return "https://" + InetAddress.getLocalHost().getCanonicalHostName() + ":" + httpServer.getAddress().getPort();
}
- return "http://" + InetAddress.getLocalHost().getHostName() + ":" + httpServer.getAddress().getPort();
+ return "http://" + InetAddress.getLocalHost().getCanonicalHostName() + ":" + httpServer.getAddress().getPort();
} catch (UnknownHostException ex) {
return "http://localhost" + ":" + httpServer.getAddress().getPort();
}