Re: Request.getRequestURL and Response.sendRedirect
Knut Forkalsrud <[email protected]> Tue, 18 Jul 2006 16:07:02 -0700
| Newsgroups | gmane.text.xml.resin.user |
|---|---|
| Organization | Commission Junction |
| Message-ID | <[email protected]> |
I reported a bug on getServerPort() a while back http://bugs.caucho.com/view.php?id=77 which was resolved so that it now uses the HTTP/1.1 Host header, so I'm surprised that you see different behavior. Or maybe I don't understand your test case... -Knut stefan <[email protected]> writes: > 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