Use method references when possible
See gh-40974
This commit is contained in:
committed by
Phillip Webb
parent
ef99ce0ba9
commit
507229eef8
@@ -24,6 +24,8 @@ import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.security.config.Customizer;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.CsrfConfigurer;
|
||||
import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer.FrameOptionsConfig;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
|
||||
@Profile("dev")
|
||||
@@ -35,8 +37,8 @@ public class DevProfileSecurityConfiguration {
|
||||
SecurityFilterChain h2ConsoleSecurityFilterChain(HttpSecurity http) throws Exception {
|
||||
http.securityMatcher(PathRequest.toH2Console());
|
||||
http.authorizeHttpRequests(yourCustomAuthorization());
|
||||
http.csrf((csrf) -> csrf.disable());
|
||||
http.headers((headers) -> headers.frameOptions((frame) -> frame.sameOrigin()));
|
||||
http.csrf(CsrfConfigurer::disable);
|
||||
http.headers((headers) -> headers.frameOptions(FrameOptionsConfig::sameOrigin));
|
||||
return http.build();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user