You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2004/08/24 21:46:36 UTC

DO NOT REPLY [Bug 30833] - request.getServerPort() returns wrong port (WAS: response.sendRedirect() does not include port)

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30833>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30833

request.getServerPort() returns wrong port (WAS: response.sendRedirect() does not include port)

jks@iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|response.sendRedirect() does|request.getServerPort()
                   |not include port            |returns wrong port (WAS:
                   |                            |response.sendRedirect() does
                   |                            |not include port)



------- Additional Comments From jks@iname.com  2004-08-24 19:46 -------
upon further investigation request.getServerPort() is returning 80 instead of
81.  I don't know why sometimes it works and sometimes it doesn't.

To test put this in a jsp:
<%= request.getServerPort() %>

$ telnet login.d1segs.selectacast.net 81
Trying 199.107.233.211...
Connected to login.d1segs.selectacast.net.
Escape character is '^]'.
GET /server-port.jsp HTTP/1.1
HOST: login.d1segs.selectacast.net

HTTP/1.1 200 OK
Date: Tue, 24 Aug 2004 19:43:22 GMT
Server: Apache/2.0.50 (Unix) mod_ssl/2.0.50 OpenSSL/0.9.7a mod_jk/1.2.5
Set-Cookie: JSESSIONID=1E19BDEFF3713F319A41AFEF78ACB799; Path=/
Content-Length: 3
Content-Type: text/html; charset=ISO-8859-1
X-Pad: avoid browser bug

80

... but again in the web browser it does show the correct port:
http://login.d1segs.selectacast.net:81/server-port.jsp

<note: that url is subject to be taken down at any time so it would be best to
run the test on your local machine>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org