Bug 47324 - sessionsList.jsp uses absolute urls which doesn't work for Tomcat behind a reverse proxy
sessionsList.jsp uses absolute urls which doesn't work for Tomcat behind a re...
Status: RESOLVED FIXED
Product: Tomcat 6
Classification: Unclassified
Component: Manager application
unspecified
All All
: P2 normal (vote)
: default
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2009-06-06 10:09 UTC by Maik Jablonski
Modified: 2009-10-03 14:09 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maik Jablonski 2009-06-06 10:09:35 UTC
sessionsList.jsp uses getRequestURL() which creates absolute links (with server:port included) like:

http://localhost:8080/manager/html/sessions?path=/

This is a problem when running Tomcat-Manager-Application behind a reverse proxy (e.g. apache http server), because outgoing links doesn't work anymore.

Proposed fix is to use getRequestURI instead.

29c29
<    String submitUrl = ((HttpServletRequest)pageContext.getRequest()).getRequestURL().append("?path=").append(path).toString();
---
>    String submitUrl = ((HttpServletRequest)pageContext.getRequest()).getRequestURI() + "?path=" + path;
Comment 1 Mark Thomas 2009-09-27 10:45:57 UTC
Many thanks for the patch. It has been applied to trunk and proposed for 6.0.x.
Comment 2 Mark Thomas 2009-10-03 14:09:25 UTC
This has been fixed in 6.0.x and will be in 6.0.21 onwards.

Thanks again for the patch.