aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Macdonald2011-05-17 18:10:13 (EDT)
committerBoris Bokowski2011-05-19 10:46:12 (EDT)
commit2b5b204fd1409c9553023ee89f85941d64fdc909 (patch)
tree11669df2fd392c6347fcf52097ba6a698b1f4e84
parent661b034c195c235a68f5c4df5d562617aaae4c1f (diff)
downloadorg.eclipse.orion.server-2b5b204fd1409c9553023ee89f85941d64fdc909.zip
org.eclipse.orion.server-2b5b204fd1409c9553023ee89f85941d64fdc909.tar.gz
org.eclipse.orion.server-2b5b204fd1409c9553023ee89f85941d64fdc909.tar.bz2
Bug 346139: self-hosted site launching not working
https://bugs.eclipse.org/bugs/show_bug.cgi?id=346139
-rw-r--r--bundles/org.eclipse.orion.server.hosting/src/org/eclipse/orion/internal/server/hosting/RemoteURLProxyServlet.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/bundles/org.eclipse.orion.server.hosting/src/org/eclipse/orion/internal/server/hosting/RemoteURLProxyServlet.java b/bundles/org.eclipse.orion.server.hosting/src/org/eclipse/orion/internal/server/hosting/RemoteURLProxyServlet.java
index 99409a3..343b44f 100644
--- a/bundles/org.eclipse.orion.server.hosting/src/org/eclipse/orion/internal/server/hosting/RemoteURLProxyServlet.java
+++ b/bundles/org.eclipse.orion.server.hosting/src/org/eclipse/orion/internal/server/hosting/RemoteURLProxyServlet.java
@@ -26,6 +26,11 @@ import org.mortbay.util.IO;
*/
public class RemoteURLProxyServlet extends ProxyServlet {
+ {
+ // Bug 346139
+ _DontProxyHeaders.add("host");
+ }
+
private URL url;
private final boolean failEarlyOn404;
@@ -82,6 +87,17 @@ public class RemoteURLProxyServlet extends ProxyServlet {
String hdr = (String) enm.nextElement();
String lhdr = hdr.toLowerCase();
+ if ("host".equals(lhdr)) {
+ // Bug 346139: set Host based on the destination URL being proxied
+ int port = url.getPort();
+ String realHost;
+ if (port == -1 || port == url.getDefaultPort())
+ realHost = url.getHost();
+ else
+ realHost = url.getHost() + ":" + port;
+ connection.addRequestProperty("Host", realHost);
+ }
+
if (_DontProxyHeaders.contains(lhdr))
continue;
if (connectionHdr != null && connectionHdr.indexOf(lhdr) >= 0)