1
0
mirror of synced 2026-08-07 10:47:49 +00:00

Add redirectToHttps DSL Configurer

Closes gh-16679
This commit is contained in:
Josh Cummings
2025-02-28 09:09:45 -07:00
parent 2d96fba5cf
commit be23268c37
8 changed files with 501 additions and 6 deletions
@@ -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()
}