harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r832474 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java
Date Tue, 03 Nov 2009 16:58:24 GMT
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);



Mime
View raw message