Request.getRequestURL and Response.sendRedirect

stefan <[email protected]> Tue, 18 Jul 2006 17:39:07 +0200
Newsgroups gmane.text.xml.resin.user
Message-ID <[email protected]>
------=_Part_98311_18454234.1153237147204
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi everyone,

Here's my issue in short: we're integrating a 3rd party jar that uses
Request.getRequestURL to build (surprise!) a URL; we run resin on port 8080,
and the resulting URL contains ":8080", which we don't like.

After some quick tests and source-peeking, it looks like
Response.sendRedirect does the 'proper' thing: if an HTTP 'Host' header is
present,
its value is used instead of getServerName()/getServerPort() (see
AbstractHttpResponse.getAbsolutePath)

My question is: shouldn't Request.getRequestURL (and maybe
HttpUtils.getRequestURL while we're at it) use the same logic to compute the
URL ?
The HTTP spec (see
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23 ) seems to
agree :p

This code seems to be the same on resin 2.1.17 and 3.0.19

Stefan

------=_Part_98311_18454234.1153237147204
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi everyone,<br><br>Here's my issue in short: we're integrating a 3rd party jar that uses Request.getRequestURL to build (surprise!) a URL; we run resin on port 8080,<br>and the resulting URL contains &quot;:8080&quot;, which we don't like.
<br><br>After some quick tests and source-peeking, it looks like Response.sendRedirect does the 'proper' thing: if an HTTP 'Host' header is present,<br>its value is used instead of getServerName()/getServerPort() (see AbstractHttpResponse.getAbsolutePath
)<br><br>My question is: shouldn't Request.getRequestURL (and maybe HttpUtils.getRequestURL while we're at it) use the same logic to compute the URL ? <br>The HTTP spec (see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23">
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23</a> ) seems to agree :p<br><br>This code seems to be the same on resin 2.1.17 and 3.0.19<br><br>Stefan<br><h3><br></h3>

------=_Part_98311_18454234.1153237147204--