We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6fc9f4 commit 449d103Copy full SHA for 449d103
csp-spring-security/src/main/java/de/dominikschadow/javasecurity/SecurityConfig.java
@@ -1,5 +1,5 @@
1
/*
2
- * Copyright (C) 2023 Dominik Schadow, [email protected]
+ * Copyright (C) 2025 Dominik Schadow, [email protected]
3
*
4
* This file is part of the Java Security project.
5
@@ -33,8 +33,10 @@ public class SecurityConfig {
33
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
34
// @formatter:off
35
http
36
- .headers()
37
- .contentSecurityPolicy("default-src 'self'");
+ .headers(headers -> headers
+ .contentSecurityPolicy(csp -> csp
38
+ .policyDirectives("default-src 'self'"))
39
+ );
40
// @formatter:on
41
42
return http.build();
0 commit comments