You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2009/11/03 17:58:24 UTC
svn commit: r832474 -
/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java
Author: tellison
Date: Tue Nov 3 16:58:24 2009
New Revision: 832474
URL: http://svn.apache.org/viewvc?rev=832474&view=rev
Log:
If the hostname has been resolved use the canonical name for the security check.
Modified:
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java?rev=832474&r1=832473&r2=832474&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java Tue Nov 3 16:58:24 2009
@@ -705,7 +705,9 @@
SecurityManager sm = System.getSecurityManager();
if (sm != null && proxy.type() != Proxy.Type.DIRECT) {
InetSocketAddress pAddress = (InetSocketAddress) proxy.address();
- sm.checkConnect(pAddress.getHostName(), pAddress.getPort());
+ String pHostName = pAddress.isUnresolved() ? pAddress.getHostName()
+ : pAddress.getAddress().getHostAddress();
+ sm.checkConnect(pHostName, pAddress.getPort());
}
return strmHandler.openConnection(this, proxy);