You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ri...@apache.org on 2004/09/15 02:14:20 UTC
svn commit: rev 46053 - incubator/beehive/trunk/netui/test/src/testRecorder/org/apache/beehive/netui/tools/testrecorder/server
Author: rich
Date: Tue Sep 14 17:14:19 2004
New Revision: 46053
Modified:
incubator/beehive/trunk/netui/test/src/testRecorder/org/apache/beehive/netui/tools/testrecorder/server/TestRecorderServlet.java
Log:
Changed TestRecorder so that when redirecting to a test URI, it replaces "localhost" with the current request's server name. This allows the use of the DRT test index pages from a remote machine. The idea is that if the config says the server is "localhost", then when you're displaying a link, you want that to resolve to the actual machine, not to the client's "localhost".
DRT: netui (linux)
BB: self (WinXP)
Modified: incubator/beehive/trunk/netui/test/src/testRecorder/org/apache/beehive/netui/tools/testrecorder/server/TestRecorderServlet.java
==============================================================================
--- incubator/beehive/trunk/netui/test/src/testRecorder/org/apache/beehive/netui/tools/testrecorder/server/TestRecorderServlet.java (original)
+++ incubator/beehive/trunk/netui/test/src/testRecorder/org/apache/beehive/netui/tools/testrecorder/server/TestRecorderServlet.java Tue Sep 14 17:14:19 2004
@@ -507,8 +507,12 @@
forward( request, response, msg, Constants.ERROR_PAGE, true );
return;
}
- response.sendRedirect( rd.getUri( config.getServer().getHostname(),
- config.getServer().getPort() ) );
+ String host = config.getServer().getHostname();
+ if ( host.equals( "localhost" ) )
+ {
+ host = request.getServerName();
+ }
+ response.sendRedirect( rd.getUri( host, config.getServer().getPort() ) );
return;
}
catch ( Exception e ) {