public static interface CfnResponseHeadersPolicy.CorsConfigProperty
CloudFront adds these headers to HTTP responses that it sends for CORS requests that match a cache behavior associated with this response headers policy.
For more information about CORS, see Cross-Origin Resource Sharing (CORS) in the MDN Web Docs.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.cloudfront.*; CorsConfigProperty corsConfigProperty = CorsConfigProperty.builder() .accessControlAllowCredentials(false) .accessControlAllowHeaders(AccessControlAllowHeadersProperty.builder() .items(List.of("items")) .build()) .accessControlAllowMethods(AccessControlAllowMethodsProperty.builder() .items(List.of("items")) .build()) .accessControlAllowOrigins(AccessControlAllowOriginsProperty.builder() .items(List.of("items")) .build()) .originOverride(false) // the properties below are optional .accessControlExposeHeaders(AccessControlExposeHeadersProperty.builder() .items(List.of("items")) .build()) .accessControlMaxAgeSec(123) .build();
Modifier and Type | Interface and Description |
---|---|
static class |
CfnResponseHeadersPolicy.CorsConfigProperty.Builder
A builder for
CfnResponseHeadersPolicy.CorsConfigProperty |
static class |
CfnResponseHeadersPolicy.CorsConfigProperty.Jsii$Proxy
An implementation for
CfnResponseHeadersPolicy.CorsConfigProperty |
Modifier and Type | Method and Description |
---|---|
static CfnResponseHeadersPolicy.CorsConfigProperty.Builder |
builder() |
java.lang.Object |
getAccessControlAllowCredentials()
A Boolean that CloudFront uses as the value for the `Access-Control-Allow-Credentials` HTTP response header.
|
java.lang.Object |
getAccessControlAllowHeaders()
A list of HTTP header names that CloudFront includes as values for the `Access-Control-Allow-Headers` HTTP response header.
|
java.lang.Object |
getAccessControlAllowMethods()
A list of HTTP methods that CloudFront includes as values for the `Access-Control-Allow-Methods` HTTP response header.
|
java.lang.Object |
getAccessControlAllowOrigins()
A list of origins (domain names) that CloudFront can use as the value for the `Access-Control-Allow-Origin` HTTP response header.
|
default java.lang.Object |
getAccessControlExposeHeaders()
A list of HTTP headers that CloudFront includes as values for the `Access-Control-Expose-Headers` HTTP response header.
|
default java.lang.Number |
getAccessControlMaxAgeSec()
A number that CloudFront uses as the value for the `Access-Control-Max-Age` HTTP response header.
|
java.lang.Object |
getOriginOverride()
A Boolean that determines whether CloudFront overrides HTTP response headers received from the origin with the ones specified in this response headers policy.
|
java.lang.Object getAccessControlAllowCredentials()
For more information about the Access-Control-Allow-Credentials
HTTP response header, see Access-Control-Allow-Credentials in the MDN Web Docs.
java.lang.Object getAccessControlAllowHeaders()
For more information about the Access-Control-Allow-Headers
HTTP response header, see Access-Control-Allow-Headers in the MDN Web Docs.
java.lang.Object getAccessControlAllowMethods()
For more information about the Access-Control-Allow-Methods
HTTP response header, see Access-Control-Allow-Methods in the MDN Web Docs.
java.lang.Object getAccessControlAllowOrigins()
For more information about the Access-Control-Allow-Origin
HTTP response header, see Access-Control-Allow-Origin in the MDN Web Docs.
java.lang.Object getOriginOverride()
default java.lang.Object getAccessControlExposeHeaders()
For more information about the Access-Control-Expose-Headers
HTTP response header, see Access-Control-Expose-Headers in the MDN Web Docs.
default java.lang.Number getAccessControlMaxAgeSec()
For more information about the Access-Control-Max-Age
HTTP response header, see Access-Control-Max-Age in the MDN Web Docs.
static CfnResponseHeadersPolicy.CorsConfigProperty.Builder builder()