Class StaticHeadersWriter
java.lang.Object
org.springframework.security.web.header.writers.StaticHeadersWriter
- All Implemented Interfaces:
HeaderWriter
- Direct Known Subclasses:
XContentTypeOptionsHeaderWriter
HeaderWriter
implementation which writes the same Header
instance.- Since:
- 3.2
-
Constructor Summary
ConstructorDescriptionStaticHeadersWriter
(String headerName, String... headerValues) Creates a new instance with a single headerStaticHeadersWriter
(List<Header> headers) 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
-
StaticHeadersWriter
Creates a new instance- Parameters:
headers
- theHeader
instances to use
-
StaticHeadersWriter
Creates a new instance with a single header- Parameters:
headerName
- the name of the headerheaderValues
- the values for the header
-
-
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
-