tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis GALIEGUE <...@one2team.com>
Subject Re: Request for comments: Apache-like allow/deny remote host filtering
Date Tue, 04 Oct 2011 19:10:09 GMT
On Tue, Oct 4, 2011 at 21:02, Christopher Schultz
<chris@christopherschultz.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Francis,
>
> On 10/4/2011 2:50 PM, Francis GALIEGUE wrote:
>> Patch attached. I didn't know Bugzilla would treat patches this
>> way...
>
> Can you give us a link to the bug?
>

https://issues.apache.org/bugzilla/show_bug.cgi?id=51953

[...]
>
> The good thing is that you only have to do a very simple test harness.
> Something like this:
>
> FilterConfig config = .. // mock-up the filter config
> FilterChain chain = .. // mock-up the filter chain
> Filter filter = new RemoteAddrFilter();
> filter.init(config);
>
> HttpServletRequest request = ... // mock-up request
> HttpServletResponse response = ... // mock-up response
>
> foreach(ip in test_ips) {
>  // request.setRemoteAddr(ip);
>  filter.doFilter(request, response, chain);
>
>  assertEquals(expected_status_code, response.getStatusCode());
> }
>
> Of course, you'll have to do some significant work to make sure that
> the filter chain is mocked-up correctly and that your request object
> can be programmed appropriately.
>
> Perhaps that's what you were hoping to get some help doing? :)
>

Indeed. Not right now though, I want to read some more first ;)


Thanks,
-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message