Enum Class HeadersReferrerPolicy
java.lang.Object
java.lang.Enum<HeadersReferrerPolicy>
software.amazon.awscdk.services.cloudfront.HeadersReferrerPolicy
- All Implemented Interfaces:
Serializable
,Comparable<HeadersReferrerPolicy>
,java.lang.constant.Constable
@Generated(value="jsii-pacmak/1.94.0 (build b380f01)",
date="2024-02-23T02:06:29.309Z")
@Stability(Stable)
public enum HeadersReferrerPolicy
extends Enum<HeadersReferrerPolicy>
Enum representing possible values of the Referrer-Policy HTTP response header.
Example:
// Using an existing managed response headers policy S3Origin bucketOrigin; Distribution.Builder.create(this, "myDistManagedPolicy") .defaultBehavior(BehaviorOptions.builder() .origin(bucketOrigin) .responseHeadersPolicy(ResponseHeadersPolicy.CORS_ALLOW_ALL_ORIGINS) .build()) .build(); // Creating a custom response headers policy -- all parameters optional ResponseHeadersPolicy myResponseHeadersPolicy = ResponseHeadersPolicy.Builder.create(this, "ResponseHeadersPolicy") .responseHeadersPolicyName("MyPolicy") .comment("A default policy") .corsBehavior(ResponseHeadersCorsBehavior.builder() .accessControlAllowCredentials(false) .accessControlAllowHeaders(List.of("X-Custom-Header-1", "X-Custom-Header-2")) .accessControlAllowMethods(List.of("GET", "POST")) .accessControlAllowOrigins(List.of("*")) .accessControlExposeHeaders(List.of("X-Custom-Header-1", "X-Custom-Header-2")) .accessControlMaxAge(Duration.seconds(600)) .originOverride(true) .build()) .customHeadersBehavior(ResponseCustomHeadersBehavior.builder() .customHeaders(List.of(ResponseCustomHeader.builder().header("X-Amz-Date").value("some-value").override(true).build(), ResponseCustomHeader.builder().header("X-Amz-Security-Token").value("some-value").override(false).build())) .build()) .securityHeadersBehavior(ResponseSecurityHeadersBehavior.builder() .contentSecurityPolicy(ResponseHeadersContentSecurityPolicy.builder().contentSecurityPolicy("default-src https:;").override(true).build()) .contentTypeOptions(ResponseHeadersContentTypeOptions.builder().override(true).build()) .frameOptions(ResponseHeadersFrameOptions.builder().frameOption(HeadersFrameOption.DENY).override(true).build()) .referrerPolicy(ResponseHeadersReferrerPolicy.builder().referrerPolicy(HeadersReferrerPolicy.NO_REFERRER).override(true).build()) .strictTransportSecurity(ResponseHeadersStrictTransportSecurity.builder().accessControlMaxAge(Duration.seconds(600)).includeSubdomains(true).override(true).build()) .xssProtection(ResponseHeadersXSSProtection.builder().protection(true).modeBlock(true).reportUri("https://example.com/csp-report").override(true).build()) .build()) .removeHeaders(List.of("Server")) .serverTimingSamplingRate(50) .build(); Distribution.Builder.create(this, "myDistCustomPolicy") .defaultBehavior(BehaviorOptions.builder() .origin(bucketOrigin) .responseHeadersPolicy(myResponseHeadersPolicy) .build()) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe referrer policy is not set.The referrer policy is no-referrer-when-downgrade.The referrer policy is origin.The referrer policy is origin-when-cross-origin.The referrer policy is same-origin.The referrer policy is strict-origin.The referrer policy is strict-origin-when-cross-origin.The referrer policy is unsafe-url. -
Method Summary
Modifier and TypeMethodDescriptionstatic HeadersReferrerPolicy
Returns the enum constant of this class with the specified name.static HeadersReferrerPolicy[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NO_REFERRER
The referrer policy is not set. -
NO_REFERRER_WHEN_DOWNGRADE
The referrer policy is no-referrer-when-downgrade. -
ORIGIN
The referrer policy is origin. -
ORIGIN_WHEN_CROSS_ORIGIN
The referrer policy is origin-when-cross-origin. -
SAME_ORIGIN
The referrer policy is same-origin. -
STRICT_ORIGIN
The referrer policy is strict-origin. -
STRICT_ORIGIN_WHEN_CROSS_ORIGIN
The referrer policy is strict-origin-when-cross-origin. -
UNSAFE_URL
The referrer policy is unsafe-url.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-