axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 24952] New: - tcpmon does not set the Host header correctly
Date Mon, 24 Nov 2003 20:56:39 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24952>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24952

tcpmon does not set the Host header correctly

           Summary: tcpmon does not set the Host header correctly
           Product: Axis
           Version: 1.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Basic Architecture
        AssignedTo: axis-dev@ws.apache.org
        ReportedBy: eacmen@alum.rpi.edu


When a server responds with a 302 code (Moved Temporarily) since the Host field 
in the request does not include the port number that was used it tries to 
forward without that port.  For example if I have under my webroot something 
like this:
/test/index.html
and I open a tcp monitor like this:
java org.apache.axis.utils.tcpmon 1234 localhost 8080

and I try to go to http://localhost:1234/test/

It will not work because the server responds with a 302 (to redirect to the 
actual index.html page) and the redirect URL from the server looks like:
http://localhost/test/index.html

Because in the initial request the Host header looks like this:
Host: localhost

when it should look like this:
Host: localhost:1234

To fix this you need to change tcpmon.java in the following way:
replace line 983 with this:
int    targetPort = Integer.parseInt(listener.tPortField.getText());
int   listenPort = Integer.parseInt(listener.portField.getText());

and 1104 with this:
String newHost = "Host: " + targetHost + ":" + listenPort + "\r\n";

I have already fixed this bug and compiled it and it works on my machine, but I 
myself cannot checkin the fix.  If you want the updated tcpmon.java file please 
email me and I will give it to you.

Mime
View raw message