Skip to content

Commit 449d103

Browse files
committed
replaced deprecated API usage
1 parent f6fc9f4 commit 449d103

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

csp-spring-security/src/main/java/de/dominikschadow/javasecurity/SecurityConfig.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2023 Dominik Schadow, [email protected]
2+
* Copyright (C) 2025 Dominik Schadow, [email protected]
33
*
44
* This file is part of the Java Security project.
55
*
@@ -33,8 +33,10 @@ public class SecurityConfig {
3333
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
3434
// @formatter:off
3535
http
36-
.headers()
37-
.contentSecurityPolicy("default-src 'self'");
36+
.headers(headers -> headers
37+
.contentSecurityPolicy(csp -> csp
38+
.policyDirectives("default-src 'self'"))
39+
);
3840
// @formatter:on
3941

4042
return http.build();

0 commit comments

Comments
 (0)