com.sun.jersey.api.client.filter
Class CsrfProtectionFilter
java.lang.Object
com.sun.jersey.api.client.filter.ClientFilter
com.sun.jersey.api.client.filter.CsrfProtectionFilter
- All Implemented Interfaces:
- ClientHandler
public class CsrfProtectionFilter
- extends ClientFilter
Simple client-side filter that adds X-Requested-By headers to all state-changing
request (i.e. request for methods other than GET, HEAD and OPTIONS).
This is to satisfy the requirements of the com.sun.jersey.api.container.filter.CsrfProtectionFilter
on the server side.
- Author:
- Martin Matula
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CsrfProtectionFilter
public CsrfProtectionFilter()
CsrfProtectionFilter
public CsrfProtectionFilter(String requestedBy)
- Initialized the filter with a desired value of the X-Requested-By header.
- Parameters:
requestedBy
- Desired value of X-Requested-By header the filter
will be adding for all potentially state changing requests.
handle
public ClientResponse handle(ClientRequest cr)
throws ClientHandlerException
- Adds X-Requested-By header (if not present) to potentially state changing requests.
- Specified by:
handle
in interface ClientHandler
- Specified by:
handle
in class ClientFilter
- Parameters:
cr
- Client request to be processed.
- Returns:
- Response
- Throws:
ClientHandlerException
Copyright © 2011 Oracle Corporation. All Rights Reserved.