From 31b5d8980ed4c767bea5f33571d104814fb552f0 Mon Sep 17 00:00:00 2001 From: theli Date: Sun, 2 Jul 2006 13:03:01 +0000 Subject: [PATCH] *) Bugfix for basic config redirection bug see: http://www.yacy-forum.de/viewtopic.php?p=23503 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2269 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/ConfigBasic.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/htroot/ConfigBasic.java b/htroot/ConfigBasic.java index 9aa64fa6b..8b989cefc 100644 --- a/htroot/ConfigBasic.java +++ b/htroot/ConfigBasic.java @@ -135,9 +135,19 @@ public class ConfigBasic { // redirect the browser to the new port reconnect = true; + + String host = null; + if (header.containsKey(httpHeader.HOST)) { + host = (String)header.get(httpHeader.HOST); + int idx = host.indexOf(":"); + if (idx != -1) host = host.substring(0,idx); + } else { + host = serverCore.publicLocalIP().getHostAddress(); + } + prop.put("reconnect", 1); - prop.put("reconnect_host", serverCore.publicLocalIP().getHostAddress()); - prop.put("nextStep_host", serverCore.publicLocalIP().getHostAddress()); + prop.put("reconnect_host", host); + prop.put("nextStep_host", host); prop.put("reconnect_port", port); prop.put("nextStep_port", port); prop.put("reconnect_sslSupport", theServerCore.withSSL() ? 1:0);