Add redirectToHttps DSL Configurer
Closes gh-16679
This commit is contained in:
@@ -27,9 +27,7 @@ public class WebSecurityConfig {
|
||||
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
http
|
||||
// ...
|
||||
.requiresChannel(channel -> channel
|
||||
.anyRequest().requiresSecure()
|
||||
);
|
||||
.redirectToHttps(withDefaults());
|
||||
return http.build();
|
||||
}
|
||||
}
|
||||
@@ -47,9 +45,7 @@ class SecurityConfig {
|
||||
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
|
||||
http {
|
||||
// ...
|
||||
requiresChannel {
|
||||
secure(AnyRequestMatcher.INSTANCE, "REQUIRES_SECURE_CHANNEL")
|
||||
}
|
||||
redirectToHttps { }
|
||||
}
|
||||
return http.build()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user