Class StrictTransportSecurityServerHttpHeadersWriter
java.lang.Object
org.springframework.security.web.server.header.StrictTransportSecurityServerHttpHeadersWriter
- All Implemented Interfaces:
- ServerHttpHeadersWriter
public final class StrictTransportSecurityServerHttpHeadersWriter
extends Object
implements ServerHttpHeadersWriter
Writes the Strict-Transport-Security if the request is secure.
- Since:
- 5.0
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidsetIncludeSubDomains(boolean includeSubDomains) Sets if subdomains should be included.voidSets the max age of the header.voidsetPreload(boolean preload) Sets if preload should be included.reactor.core.publisher.Mono<Void>writeHttpHeaders(org.springframework.web.server.ServerWebExchange exchange) Write the headers to the response.
- 
Field Details- 
STRICT_TRANSPORT_SECURITY- See Also:
 
 
- 
- 
Constructor Details- 
StrictTransportSecurityServerHttpHeadersWriterpublic StrictTransportSecurityServerHttpHeadersWriter()
 
- 
- 
Method Details- 
writeHttpHeaderspublic reactor.core.publisher.Mono<Void> writeHttpHeaders(org.springframework.web.server.ServerWebExchange exchange) Description copied from interface:ServerHttpHeadersWriterWrite the headers to the response.- Specified by:
- writeHttpHeadersin interface- ServerHttpHeadersWriter
- Returns:
- A Mono which is returned to the Supplierof theReactiveHttpOutputMessage.beforeCommit(Supplier).
 
- 
setIncludeSubDomainspublic void setIncludeSubDomains(boolean includeSubDomains) Sets if subdomains should be included. Default is true- Parameters:
- includeSubDomains- if subdomains should be included
 
- 
setPreloadpublic void setPreload(boolean preload) Sets if preload should be included. Default is false See Website hstspreload.org for additional details. - Parameters:
- preload- if preload should be included
- Since:
- 5.2.0
 
- 
setMaxAgeSets the max age of the header. Default is a year.- Parameters:
- maxAge- the max age of the header
 
 
-