Class DelegatingRequestMatcherHeaderWriter
java.lang.Object
org.springframework.security.web.header.writers.DelegatingRequestMatcherHeaderWriter
- All Implemented Interfaces:
HeaderWriter
Delegates to the provided
HeaderWriter
when
RequestMatcher.matches(HttpServletRequest)
returns true.- Since:
- 3.2
-
Constructor Summary
ConstructorDescriptionDelegatingRequestMatcherHeaderWriter
(RequestMatcher requestMatcher, HeaderWriter delegateHeaderWriter) Creates a new instance -
Method Summary
Modifier and TypeMethodDescriptiontoString()
void
writeHeaders
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Create aHeader
instance.
-
Constructor Details
-
DelegatingRequestMatcherHeaderWriter
public DelegatingRequestMatcherHeaderWriter(RequestMatcher requestMatcher, HeaderWriter delegateHeaderWriter) Creates a new instance- Parameters:
requestMatcher
- theRequestMatcher
to use. If returns true, the delegateHeaderWriter will be invoked.delegateHeaderWriter
- theHeaderWriter
to invoke if theRequestMatcher
returns true.
-
-
Method Details
-
writeHeaders
public void writeHeaders(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Description copied from interface:HeaderWriter
Create aHeader
instance.- Specified by:
writeHeaders
in interfaceHeaderWriter
- Parameters:
request
- the requestresponse
- the response
-
toString
-