I'd like to contribute a ProxyServlet that I've been using the
UrlRewriteFilter project. You can review the source for this at the
following URL (click "click here" after the page loads):
http://raibledesigns.com/rd/entry/how_to_do_cross_domain#proxyServlet
I've recently improved this source on my current project and added
some tests (~65% coverage). Would this be something you'd be willing
to add to the UrlRewriteFilter project?
Current dependencies include the following:
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.1</version>
</dependency>
Thanks!
Matt
Disclaimer: I'm not an uwf developer, just hang out on the ml and
write small patches sometimes.
On Fri, Feb 12, 2010 at 12:50 AM, Matt Raible <ma...@raibledesigns.com> wrote:
> Hello,
>
> I'd like to contribute a ProxyServlet that I've been using the
> UrlRewriteFilter project. You can review the source for this at the
> following URL (click "click here" after the page loads):
>
> http://raibledesigns.com/rd/entry/how_to_do_cross_domain#proxyServlet
I read some of the source and got as far as realising that yes indeed
it's a proxyServlet. :-) Is this then supposed to be a more general
version of the <to type="proxy"> element? How exactly does it fit in
with the rest of the filter? Just curious as I suppose it might come
in handy at some point.
regards,
Wim
I've always suspected my ProxyServlet could be replaced by the
UrlRewriteFilter. I'll try that today.
One unique feature of my servlet (that the URF might not have) is it
supports file upload. Looking at the the dependencies of the proxy
element (commons-http and commons-codec), I'm guessing file upload is
not supported?
Thanks,
Matt
>
> regards,
> Wim
>
> --
> You received this message because you are subscribed to the Google Groups "UrlRewrite" group.
> To post to this group, send email to urlre...@googlegroups.com.
> To unsubscribe from this group, send email to urlrewrite+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en.
>
>
On Fri, Feb 12, 2010 at 3:04 PM, Matt Raible <ma...@raibledesigns.com> wrote:
> On Fri, Feb 12, 2010 at 6:35 AM, Wim De Smet <kro...@gmail.com> wrote:
>> Hi,
>>
>> Disclaimer: I'm not an uwf developer, just hang out on the ml and
>> write small patches sometimes.
>>
>> On Fri, Feb 12, 2010 at 12:50 AM, Matt Raible <ma...@raibledesigns.com> wrote:
>>> Hello,
>>>
>>> I'd like to contribute a ProxyServlet that I've been using the
>>> UrlRewriteFilter project. You can review the source for this at the
>>> following URL (click "click here" after the page loads):
>>>
>>> http://raibledesigns.com/rd/entry/how_to_do_cross_domain#proxyServlet
>>
>> I read some of the source and got as far as realising that yes indeed
>> it's a proxyServlet. :-) Is this then supposed to be a more general
>> version of the <to type="proxy"> element? How exactly does it fit in
>> with the rest of the filter? Just curious as I suppose it might come
>> in handy at some point.
>
> I've always suspected my ProxyServlet could be replaced by the
> UrlRewriteFilter. I'll try that today.
>
> One unique feature of my servlet (that the URF might not have) is it
> supports file upload. Looking at the the dependencies of the proxy
> element (commons-http and commons-codec), I'm guessing file upload is
> not supported?
I couldn't say, it'd probably be best to just have a look at the
relevant code. I did recall one issue being posted a while ago:
http://code.google.com/p/urlrewritefilter/issues/detail?id=53
Judging from that apparently there is support for it, tho maybe a bit
buggy. I'll have a look at that patch when I get the time and maybe
add some test cases.
regards,
Wim
Didn't work, unless there's a way for the UrlRewriteFilter's proxy
functionality to follow redirects:
010-02-12 10:19:23.172:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: execute, target is http://gsa.company.com/search
2010-02-12 10:19:23.174:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: response commit state: false
2010-02-12 10:19:23.174:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: checking url
2010-02-12 10:19:23.174:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: seting up the host configuration
2010-02-12 10:19:23.177:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: config is HostConfiguration[host=http://gsa.company.com]
2010-02-12 10:19:23.178:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting proxy request parameter:User-Agent, value: Mozilla/5.0
(Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.2) Gecko/20090729
Firefox/3.5.2
2010-02-12 10:19:23.178:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting proxy request parameter:Accept, value: application/xml,
text/xml, */*
2010-02-12 10:19:23.178:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting proxy request parameter:Accept-Language, value:
en-us,en;q=0.8,es;q=0.6,nl;q=0.4,fr;q=0.2
2010-02-12 10:19:23.178:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting proxy request parameter:Accept-Charset, value:
ISO-8859-1,utf-8;q=0.7,*;q=0.7
2010-02-12 10:19:23.178:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting proxy request parameter:Keep-Alive, value: 300
2010-02-12 10:19:23.178:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting proxy request parameter:Connection, value: keep-alive
2010-02-12 10:19:23.179:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting proxy request parameter:Referer, value:
http://localhost:9000/search-results?terms=foo
2010-02-12 10:19:23.179:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting proxy request parameter:X-Requested-With, value:
XMLHttpRequest
2010-02-12 10:19:23.179:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: proxy query string null
2010-02-12 10:19:23.179:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: client state[ | | ]
2010-02-12 10:19:23.179:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: client paramsorg.apache.commons.httpclient.params.HttpClientParams@67219b8c
2010-02-12 10:19:23.186:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: executeMethod / fetching data ...
2010-02-12 10:19:23.200:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: execute, target is http://gsa.company.com/search
2010-02-12 10:19:23.200:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: response commit state: false
2010-02-12 10:19:23.200:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: checking url
2010-02-12 10:19:23.200:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: seting up the host configuration
2010-02-12 10:19:23.201:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: config is HostConfiguration[host=http://gsa.company.com]
2010-02-12 10:19:23.201:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting proxy request parameter:User-Agent, value: Mozilla/5.0
(Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.2) Gecko/20090729
Firefox/3.5.2
2010-02-12 10:19:23.201:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting proxy request parameter:Accept, value: application/xml,
text/xml, */*
2010-02-12 10:19:23.201:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting proxy request parameter:Accept-Language, value:
en-us,en;q=0.8,es;q=0.6,nl;q=0.4,fr;q=0.2
2010-02-12 10:19:23.201:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting proxy request parameter:Accept-Charset, value:
ISO-8859-1,utf-8;q=0.7,*;q=0.7
2010-02-12 10:19:23.201:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting proxy request parameter:Keep-Alive, value: 300
2010-02-12 10:19:23.201:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting proxy request parameter:Connection, value: keep-alive
2010-02-12 10:19:23.201:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting proxy request parameter:Referer, value:
http://localhost:9000/search-results?terms=foo
2010-02-12 10:19:23.201:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting proxy request parameter:X-Requested-With, value:
XMLHttpRequest
2010-02-12 10:19:23.202:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: proxy query string null
2010-02-12 10:19:23.202:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: client state[ | | ]
2010-02-12 10:19:23.202:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: client paramsorg.apache.commons.httpclient.params.HttpClientParams@7f38f3d1
2010-02-12 10:19:23.202:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: executeMethod / fetching data ...
2010-02-12 10:19:23.632:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setupResponseHeaders
2010-02-12 10:19:23.632:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: status text: Found
2010-02-12 10:19:23.633:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: status line: HTTP/1.0 302 Found
2010-02-12 10:19:23.633:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting response parameter:Connection, value: Close
2010-02-12 10:19:23.633:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting response parameter:Location, value:
http://gsa.company.com:80/
2010-02-12 10:19:23.633:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting response parameter:Content-Type, value: text/html
2010-02-12 10:19:23.633:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: set up response, result code was 302
2010-02-12 10:19:23.645:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setupResponseHeaders
2010-02-12 10:19:23.645:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: status text: Found
2010-02-12 10:19:23.645:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: status line: HTTP/1.0 302 Found
2010-02-12 10:19:23.645:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting response parameter:Connection, value: Close
2010-02-12 10:19:23.645:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting response parameter:Location, value:
http://gsa.company.com:80/
2010-02-12 10:19:23.645:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: setting response parameter:Content-Type, value: text/html
2010-02-12 10:19:23.646:INFO:/:org.tuckey.web.filters.urlrewrite.RequestProxy
INFO: set up response, result code was 302
http://code.google.com/p/urlrewritefilter/issues/detail?id=58
Looks like there's already an open issue for this:
http://code.google.com/p/urlrewritefilter/issues/detail?id=58