Class HeadersConfigurer.ContentSecurityPolicyConfig
- java.lang.Object
-
- org.springframework.security.config.annotation.web.configurers.HeadersConfigurer.ContentSecurityPolicyConfig
-
- Enclosing class:
- HeadersConfigurer<H extends HttpSecurityBuilder<H>>
public final class HeadersConfigurer.ContentSecurityPolicyConfig extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HeadersConfigurer<H>
and()
Allows completing configuration of Content Security Policy and continuing configuration of headers.HeadersConfigurer.ContentSecurityPolicyConfig
policyDirectives(java.lang.String policyDirectives)
Sets the security policy directive(s) to be used in the response header.HeadersConfigurer.ContentSecurityPolicyConfig
reportOnly()
Enables (includes) the Content-Security-Policy-Report-Only header in the response.
-
-
-
Method Detail
-
policyDirectives
public HeadersConfigurer.ContentSecurityPolicyConfig policyDirectives(java.lang.String policyDirectives)
Sets the security policy directive(s) to be used in the response header.- Parameters:
policyDirectives
- the security policy directive(s)- Returns:
- the
HeadersConfigurer.ContentSecurityPolicyConfig
for additional configuration - Throws:
java.lang.IllegalArgumentException
- if policyDirectives is null or empty
-
reportOnly
public HeadersConfigurer.ContentSecurityPolicyConfig reportOnly()
Enables (includes) the Content-Security-Policy-Report-Only header in the response.- Returns:
- the
HeadersConfigurer.ContentSecurityPolicyConfig
for additional configuration
-
and
public HeadersConfigurer<H> and()
Allows completing configuration of Content Security Policy and continuing configuration of headers.- Returns:
- the
HeadersConfigurer
for additional configuration
-
-