equal
deleted
inserted
replaced
901 return false; |
901 return false; |
902 } |
902 } |
903 |
903 |
904 private String getHostAndPort(URL url) { |
904 private String getHostAndPort(URL url) { |
905 String host = url.getHost(); |
905 String host = url.getHost(); |
|
906 final String hostarg = host; |
|
907 try { |
|
908 // lookup hostname and use IP address if available |
|
909 host = AccessController.doPrivileged( |
|
910 new PrivilegedExceptionAction<String>() { |
|
911 public String run() throws IOException { |
|
912 InetAddress addr = InetAddress.getByName(hostarg); |
|
913 return addr.getHostAddress(); |
|
914 } |
|
915 } |
|
916 ); |
|
917 } catch (PrivilegedActionException e) {} |
906 int port = url.getPort(); |
918 int port = url.getPort(); |
907 if (port == -1) { |
919 if (port == -1) { |
908 String scheme = url.getProtocol(); |
920 String scheme = url.getProtocol(); |
909 if ("http".equals(scheme)) { |
921 if ("http".equals(scheme)) { |
910 return host + ":80"; |
922 return host + ":80"; |