Class CsrfProtectionFilter
java.lang.Object
org.glassfish.jersey.client.filter.CsrfProtectionFilter
- All Implemented Interfaces:
ClientRequestFilter
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
org.glassfish.jersey.server.filter.CsrfProtectionFilter
on the server side.- Author:
- Martin Matula
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Name of the header this filter will attach to the request. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of the filter with X-Requested-By header value set to empty string.CsrfProtectionFilter
(String requestedBy) Initialized the filter with a desired value of the X-Requested-By header. -
Method Summary
-
Field Details
-
HEADER_NAME
Name of the header this filter will attach to the request.- See Also:
-
-
Constructor Details
-
CsrfProtectionFilter
public CsrfProtectionFilter()Creates a new instance of the filter with X-Requested-By header value set to empty string. -
CsrfProtectionFilter
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.
-
-
Method Details
-
filter
- Specified by:
filter
in interfaceClientRequestFilter
- Throws:
IOException
-