public static interface RestCsrfPreventionFilter.HttpInteraction
RestCsrfPreventionFilter.doFilter(ServletRequest, ServletResponse, FilterChain)
method.
Applications that do run inside a servlet container will not need to write
code that uses this interface. Instead, they can use typical servlet
container configuration mechanisms to insert the filter.Modifier and Type | Method and Description |
---|---|
java.lang.String |
getHeader(java.lang.String header)
Returns the value of a header.
|
java.lang.String |
getMethod()
Returns the method.
|
void |
proceed()
Called by the filter after it decides that the request may proceed.
|
void |
sendError(int code,
java.lang.String message)
Called by the filter after it decides that the request is a potential
CSRF attack and therefore must be rejected.
|
java.lang.String getHeader(java.lang.String header)
header
- name of headerjava.lang.String getMethod()
void proceed() throws java.io.IOException, ServletException
java.io.IOException
- if there is an I/O errorServletException
- if the implementation relies on the servlet API
and a servlet API call has failedvoid sendError(int code, java.lang.String message) throws java.io.IOException
code
- status code to sendmessage
- response messagejava.io.IOException
- if there is an I/O error