tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohit Anchlia <>
Subject Re: Servlet Request URL
Date Tue, 09 Aug 2011 17:19:49 GMT
I think I resolved it. It looks like if I keep the "Host" header set
to incoming request it works just fine. I am assuming Proxies do the
same thing. And it also looks like HttpServletRequest.getRequestURL
uses http header Host to get the host name.

On Mon, Aug 8, 2011 at 10:50 PM, Mohit Anchlia <> wrote:
> I need to intercept a request in the servlet and send the request
> after some processing as a proxy. Currently when I do that it breaks
> OAuth since customer uses REQUEST URL to sign the request and since
> host part of the URL is changing it breaks that validation. Is there a
> way I can keep the same host name as original and still be able to
> send HTTP post request to another servlet?
> I tried RewriteRule but it doesn't work. Not sure what's going on
> since I am not sure how to debug with tomcat. I tried ^/(.*)
> http://localhost/$1 [PT] but for some reason it just gets lost. I am
> in a fix since I can't use [R] or [P] because it causes 301 instead.
> All I need to do is be able to keep the same host name so that when it
> gets to the destination servlet from interceptor it passed OAuth.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message