Class ServerHttpSecurity.HttpsRedirectSpec
java.lang.Object
org.springframework.security.config.web.server.ServerHttpSecurity.HttpsRedirectSpec
- Enclosing class:
- ServerHttpSecurity
Configures HTTPS redirection rules
- Since:
- 5.1
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionand()
Deprecated, for removal: This API element is subject to removal in a future version.protected void
configure
(ServerHttpSecurity http) httpsRedirectWhen
(Function<org.springframework.web.server.ServerWebExchange, Boolean> when) Configures when this filter should redirect to https By default, the filter will redirect whenever an exchange's scheme is not httpshttpsRedirectWhen
(ServerWebExchangeMatcher... matchers) Configures when this filter should redirect to https By default, the filter will redirect whenever an exchange's scheme is not httpsportMapper
(PortMapper portMapper) Configures a custom HTTPS port to redirect to
-
Constructor Details
-
HttpsRedirectSpec
public HttpsRedirectSpec()
-
-
Method Details
-
httpsRedirectWhen
Configures when this filter should redirect to https By default, the filter will redirect whenever an exchange's scheme is not https- Parameters:
matchers
- the list of conditions that, when any are met, the filter should redirect to https- Returns:
- the
ServerHttpSecurity.HttpsRedirectSpec
for additional configuration
-
httpsRedirectWhen
public ServerHttpSecurity.HttpsRedirectSpec httpsRedirectWhen(Function<org.springframework.web.server.ServerWebExchange, Boolean> when) Configures when this filter should redirect to https By default, the filter will redirect whenever an exchange's scheme is not https- Parameters:
when
- determines when to redirect to https- Returns:
- the
ServerHttpSecurity.HttpsRedirectSpec
for additional configuration
-
portMapper
Configures a custom HTTPS port to redirect to- Parameters:
portMapper
- thePortMapper
to use- Returns:
- the
ServerHttpSecurity.HttpsRedirectSpec
for additional configuration
-
configure
-
and
Deprecated, for removal: This API element is subject to removal in a future version.Allows method chaining to continue configuring theServerHttpSecurity
- Returns:
- the
ServerHttpSecurity
to continue configuring
-
ServerHttpSecurity.redirectToHttps(Customizer)