Package org.springframework.security.config.annotation.web.configurers

# Class HeadersConfigurer.CrossOriginResourcePolicyConfig

java.lang.Object
org.springframework.security.config.annotation.web.configurers.HeadersConfigurer.CrossOriginResourcePolicyConfig

Enclosing class:
  HeadersConfigurer<H extends HttpSecurityBuilder<H>>

public final class HeadersConfigurer.CrossOriginResourcePolicyConfig extends Object

## Constructor Summary

Constructors
Constructor
Description
`CrossOriginResourcePolicyConfig()`

## Method Summary

Modifier and Type
Method
Description
`HeadersConfigurer<H>`
`and()`
Deprecated, for removal: This API element is subject to removal in a future version.
For removal in 7.0.
`HeadersConfigurer<H>.CrossOriginResourcePolicyConfig`
`policy(org.springframework.security.web.header.writers.CrossOriginResourcePolicyHeaderWriter.CrossOriginResourcePolicy resourcePolicy)`
Sets the policy to be used in the `Cross-Origin-Resource-Policy` header

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### CrossOriginResourcePolicyConfig

public CrossOriginResourcePolicyConfig()

## Method Details

### policy

public HeadersConfigurer<H>.CrossOriginResourcePolicyConfig policy(org.springframework.security.web.header.writers.CrossOriginResourcePolicyHeaderWriter.CrossOriginResourcePolicy resourcePolicy)
Sets the policy to be used in the `Cross-Origin-Resource-Policy` header

Parameters:
  `resourcePolicy` - a `Cross-Origin-Resource-Policy`
Returns:
  the `HeadersConfigurer<H extends HttpSecurityBuilder<H>>.CrossOriginResourcePolicyConfig` for additional configuration
Throws:
  `IllegalArgumentException` - if resourcePolicy is null

### and

@Deprecated(since="6.1", forRemoval=true) public HeadersConfigurer<H> and()
Deprecated, for removal: This API element is subject to removal in a future version.
For removal in 7.0. Use `HeadersConfigurer.crossOriginResourcePolicy(Customizer)` instead
Allows completing configuration of Cross-Origin-Resource-Policy and continuing configuration of headers.

Returns:
  the `HeadersConfigurer` for additional configuration