Class SecurityMockMvcRequestPostProcessors.CsrfRequestPostProcessor
java.lang.Object
com.codename1.backend.test.SecurityMockMvcRequestPostProcessors.CsrfRequestPostProcessor
- All Implemented Interfaces:
RequestPostProcessor
- Enclosing class:
SecurityMockMvcRequestPostProcessors
public static final class SecurityMockMvcRequestPostProcessors.CsrfRequestPostProcessor
extends Object
implements RequestPostProcessor
SecurityMockMvcRequestPostProcessors.csrf(), to refine.
The chain is told what token to expect for this one request, so no page
has to be fetched first. The names are the defaults -- the _csrf
parameter and the X-CSRF-TOKEN header -- whichever repository the chain
uses.
-
Method Summary
Modifier and TypeMethodDescriptionasHeader()Sends the token in theX-CSRF-TOKENheader instead of a parameter.postProcessRequest(MockRequestBuilder request) The request to send:requestchanged, usually.Sends a token that is not the expected one, to see it refused.
-
Method Details
-
asHeader
Sends the token in theX-CSRF-TOKENheader instead of a parameter. -
useInvalidToken
Sends a token that is not the expected one, to see it refused. -
postProcessRequest
Description copied from interface:RequestPostProcessorThe request to send:requestchanged, usually.- Specified by:
postProcessRequestin interfaceRequestPostProcessor
-