From: megacz Date: Fri, 30 Jan 2004 06:48:39 +0000 (+0000) Subject: 2002/07/01 22:02:10 X-Git-Tag: RC3~1653 X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=commitdiff_plain;h=661e5e64aef5d1fac83ed5ae0557e82b94a54bda 2002/07/01 22:02:10 darcs-hash:20040130064839-2ba56-de7a737066b636802dc06b9718c479e33e8ee440.gz --- diff --git a/CHANGES b/CHANGES index c1a3330..a872ea5 100644 --- a/CHANGES +++ b/CHANGES @@ -234,3 +234,5 @@ 01-Jul megacz Platform.java: initial window size fixes +01-Jul megacz HTTP.java: we no longer insert the IP into the URL. + diff --git a/src/org/xwt/HTTP.java b/src/org/xwt/HTTP.java index 702e993..6323b52 100644 --- a/src/org/xwt/HTTP.java +++ b/src/org/xwt/HTTP.java @@ -65,7 +65,7 @@ public class HTTP { host = this.url.getHost(); if (Log.on) Log.log(this, "creating HTTP object for connection to " + host + ":" + port); addHeader("Host", host); // host header is always sent verbatim - if (!skipResolveCheck) host = resolveAndCheckIfFirewalled(host); // might have to use the strict IP if behind a proxy + if (!skipResolveCheck) resolveAndCheckIfFirewalled(host); // might have to use the strict IP if behind a proxy ProxyInfo pi = Platform.detectProxy(); if (sock == null && pi != null && pi.proxyAutoConfigFunction != null) sock = attemptPAC(pi.proxyAutoConfigFunction); @@ -83,13 +83,13 @@ public class HTTP { * resolves the hostname and returns it as a string in the form "x.y.z.w", except for the special case "xmlrpc.xwt.org". * @throws HTTPException if the host falls within a firewalled netblock */ - private String resolveAndCheckIfFirewalled(String host) throws HTTPException { + private void resolveAndCheckIfFirewalled(String host) throws HTTPException { // special case - if (host.equals("xmlrpc.xwt.org")) return host; + if (host.equals("xmlrpc.xwt.org")) return; // cached - if (resolvedHosts.get(host) != null) return (String)resolvedHosts.get(host); + if (resolvedHosts.get(host) != null) return; if (Log.on) Log.log(this, " resolveAndCheckIfFirewalled: resolving " + host); @@ -101,7 +101,7 @@ public class HTTP { (quadbyte[0] == 192 && quadbyte[1] == 168) || (quadbyte[0] == 172 && (quadbyte[1] & 0xF0) == 16)) && !addr.equals(Main.originAddr)) throw new HTTPException("security violation: " + host + " [" + addr.getHostAddress() + "] is in a firewalled netblock"); - return addr.getHostAddress(); + return; } catch (UnknownHostException uhe) { } // resolve using xmlrpc.xwt.org @@ -111,7 +111,7 @@ public class HTTP { Object ret = new XMLRPC("http://xmlrpc.xwt.org/RPC2/", "dns.resolve").call(new Object[] { host }); if (ret == null || !(ret instanceof String)) throw new Exception(" xmlrpc.xwt.org returned non-String: " + ret); resolvedHosts.put(host, ret); - return (String)ret; + return; } catch (Throwable e) { throw new HTTPException("exception while attempting to use xmlrpc.xwt.org to resolve " + host + ": " + e); }