|
1 | | -/** |
2 | | - * OWASP Enterprise Security API (ESAPI) |
3 | | - * |
4 | | - * This file is part of the Open Web Application Security Project (OWASP) |
5 | | - * Enterprise Security API (ESAPI) project. For details, please see |
6 | | - * <a href="http://www.owasp.org/index.php/ESAPI">http://www.owasp.org/index.php/ESAPI</a>. |
7 | | - * |
8 | | - * Copyright (c) 2007 - The OWASP Foundation |
9 | | - * |
10 | | - * The ESAPI is published by OWASP under the BSD license. You should read and accept the |
11 | | - * LICENSE before you use, modify, and/or redistribute this software. |
12 | | - * |
13 | | - * @author Jeff Williams <a href="http://www.aspectsecurity.com">Aspect Security</a> |
14 | | - * @created 2007 |
15 | | - */ |
16 | | -package org.owasp.esapi.http; |
17 | | - |
18 | | -import java.io.IOException; |
19 | | - |
20 | | -import javax.servlet.FilterChain; |
21 | | -import javax.servlet.ServletException; |
22 | | -import javax.servlet.ServletRequest; |
23 | | -import javax.servlet.ServletResponse; |
24 | | -import javax.servlet.http.Cookie; |
25 | | -import javax.servlet.http.HttpServletRequest; |
26 | | -import javax.servlet.http.HttpServletResponse; |
27 | | - |
28 | | -/** |
29 | | - * |
30 | | - * @author jwilliams |
31 | | - */ |
32 | | -public class MockFilterChain implements FilterChain { |
33 | | - /** |
34 | | - * |
35 | | - * @param request |
36 | | - * @param response |
37 | | - * @throws java.io.IOException |
38 | | - * @throws javax.servlet.ServletException |
39 | | - */ |
40 | | - public void doFilter( ServletRequest request, ServletResponse response ) throws IOException, ServletException { |
41 | | - System.out.println( "CHAIN received " + request.getClass().getName() + " and is issuing " + response.getClass().getName() ); |
42 | | - response.getOutputStream().println( " This is the body of a response for " + ((HttpServletRequest)request).getRequestURI() ); |
43 | | - ((HttpServletResponse)response).addCookie( new Cookie( "name", "value" ) ); |
44 | | - } |
45 | | - |
46 | | -} |
| 1 | +/** |
| 2 | + * OWASP Enterprise Security API (ESAPI) |
| 3 | + * |
| 4 | + * This file is part of the Open Web Application Security Project (OWASP) |
| 5 | + * Enterprise Security API (ESAPI) project. For details, please see |
| 6 | + * <a href="http://www.owasp.org/index.php/ESAPI">http://www.owasp.org/index.php/ESAPI</a>. |
| 7 | + * |
| 8 | + * Copyright (c) 2007 - The OWASP Foundation |
| 9 | + * |
| 10 | + * The ESAPI is published by OWASP under the BSD license. You should read and accept the |
| 11 | + * LICENSE before you use, modify, and/or redistribute this software. |
| 12 | + * |
| 13 | + * @author Jeff Williams <a href="http://www.aspectsecurity.com">Aspect Security</a> |
| 14 | + * @created 2007 |
| 15 | + */ |
| 16 | +package org.owasp.esapi.http; |
| 17 | + |
| 18 | +import java.io.IOException; |
| 19 | + |
| 20 | +import javax.servlet.FilterChain; |
| 21 | +import javax.servlet.ServletException; |
| 22 | +import javax.servlet.ServletRequest; |
| 23 | +import javax.servlet.ServletResponse; |
| 24 | +import javax.servlet.http.Cookie; |
| 25 | +import javax.servlet.http.HttpServletRequest; |
| 26 | +import javax.servlet.http.HttpServletResponse; |
| 27 | + |
| 28 | +/** |
| 29 | + * |
| 30 | + * @author jwilliams |
| 31 | + */ |
| 32 | +public class MockFilterChain implements FilterChain { |
| 33 | + /** |
| 34 | + * |
| 35 | + * @param request |
| 36 | + * @param response |
| 37 | + * @throws java.io.IOException |
| 38 | + * @throws javax.servlet.ServletException |
| 39 | + */ |
| 40 | + public void doFilter( ServletRequest request, ServletResponse response ) throws IOException, ServletException { |
| 41 | + System.out.println( "CHAIN received " + request.getClass().getName() + " and is issuing " + response.getClass().getName() ); |
| 42 | + response.getOutputStream().println( " This is the body of a response for " + ((HttpServletRequest)request).getRequestURI() ); |
| 43 | + ((HttpServletResponse)response).addCookie( new Cookie( "name", "value" ) ); |
| 44 | + } |
| 45 | + |
| 46 | +} |
0 commit comments