Class ResponseHeadersXSSProtection.Builder
java.lang.Object
software.amazon.awscdk.services.cloudfront.ResponseHeadersXSSProtection.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<ResponseHeadersXSSProtection>
- Enclosing interface:
ResponseHeadersXSSProtection
@Stability(Stable)
public static final class ResponseHeadersXSSProtection.Builder
extends Object
implements software.amazon.jsii.Builder<ResponseHeadersXSSProtection>
A builder for
ResponseHeadersXSSProtection
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofResponseHeadersXSSProtection.getModeBlock()
Sets the value ofResponseHeadersXSSProtection.getOverride()
protection
(Boolean protection) Sets the value ofResponseHeadersXSSProtection.getProtection()
Sets the value ofResponseHeadersXSSProtection.getReportUri()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
override
Sets the value ofResponseHeadersXSSProtection.getOverride()
- Parameters:
override
- A Boolean that determines whether CloudFront overrides the X-XSS-Protection HTTP response header received from the origin with the one specified in this response headers policy. This parameter is required.- Returns:
this
-
protection
Sets the value ofResponseHeadersXSSProtection.getProtection()
- Parameters:
protection
- A Boolean that determines the value of the X-XSS-Protection HTTP response header. This parameter is required. When this setting is true, the value of the X-XSS-Protection header is 1. When this setting is false, the value of the X-XSS-Protection header is 0.- Returns:
this
-
modeBlock
Sets the value ofResponseHeadersXSSProtection.getModeBlock()
- Parameters:
modeBlock
- A Boolean that determines whether CloudFront includes the mode=block directive in the X-XSS-Protection header.- Returns:
this
-
reportUri
Sets the value ofResponseHeadersXSSProtection.getReportUri()
- Parameters:
reportUri
- A reporting URI, which CloudFront uses as the value of the report directive in the X-XSS-Protection header. You cannot specify a ReportUri when ModeBlock is true.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<ResponseHeadersXSSProtection>
- Returns:
- a new instance of
ResponseHeadersXSSProtection
- Throws:
NullPointerException
- if any required attribute was not provided
-