Class HttpsRedirectWebFilter
- java.lang.Object
-
- org.springframework.security.web.server.transport.HttpsRedirectWebFilter
-
- All Implemented Interfaces:
org.springframework.web.server.WebFilter
public final class HttpsRedirectWebFilter extends java.lang.Object implements org.springframework.web.server.WebFilterRedirects any non-HTTPS request to its HTTPS equivalent. Can be configured to use aServerWebExchangeMatcherto narrow which requests get redirected. Can also be configured for custom ports usingPortMapper.- Since:
- 5.1
-
-
Constructor Summary
Constructors Constructor Description HttpsRedirectWebFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Mono<java.lang.Void>filter(org.springframework.web.server.ServerWebExchange exchange, org.springframework.web.server.WebFilterChain chain)voidsetPortMapper(PortMapper portMapper)Use thisPortMapperfor mapping custom portsvoidsetRequiresHttpsRedirectMatcher(ServerWebExchangeMatcher requiresHttpsRedirectMatcher)Use thisServerWebExchangeMatcherto narrow which requests are redirected to HTTPS.
-
-
-
Method Detail
-
filter
public reactor.core.publisher.Mono<java.lang.Void> filter(org.springframework.web.server.ServerWebExchange exchange, org.springframework.web.server.WebFilterChain chain)- Specified by:
filterin interfaceorg.springframework.web.server.WebFilter
-
setPortMapper
public void setPortMapper(PortMapper portMapper)
Use thisPortMapperfor mapping custom ports- Parameters:
portMapper- thePortMapperto use
-
setRequiresHttpsRedirectMatcher
public void setRequiresHttpsRedirectMatcher(ServerWebExchangeMatcher requiresHttpsRedirectMatcher)
Use thisServerWebExchangeMatcherto narrow which requests are redirected to HTTPS. The filter already first checks for HTTPS in the uri scheme, so it is not necessary to include that check in this matcher.- Parameters:
requiresHttpsRedirectMatcher- theServerWebExchangeMatcherto use
-
-