Class CfnResponseHeadersPolicy.XSSProtectionProperty
Determines whether CloudFront includes the X-XSS-Protection HTTP response header and the header's value.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnResponseHeadersPolicy.XSSProtectionProperty : CfnResponseHeadersPolicy.IXSSProtectionProperty
Syntax (vb)
Public Class CfnResponseHeadersPolicy.XSSProtectionProperty Implements CfnResponseHeadersPolicy.IXSSProtectionProperty
Remarks
For more information about the X-XSS-Protection HTTP response header, see X-XSS-Protection in the MDN Web Docs.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudFront;
var xSSProtectionProperty = new XSSProtectionProperty {
Override = false,
Protection = false,
// the properties below are optional
ModeBlock = false,
ReportUri = "reportUri"
};
Synopsis
Constructors
| XSSProtectionProperty() | Determines whether CloudFront includes the |
Properties
| ModeBlock | A Boolean that determines whether CloudFront includes the |
| Override | A Boolean that determines whether CloudFront overrides the |
| Protection | A Boolean that determines the value of the |
| ReportUri | A reporting URI, which CloudFront uses as the value of the |
Constructors
XSSProtectionProperty()
Determines whether CloudFront includes the X-XSS-Protection HTTP response header and the header's value.
public XSSProtectionProperty()
Remarks
For more information about the X-XSS-Protection HTTP response header, see X-XSS-Protection in the MDN Web Docs.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudFront;
var xSSProtectionProperty = new XSSProtectionProperty {
Override = false,
Protection = false,
// the properties below are optional
ModeBlock = false,
ReportUri = "reportUri"
};
Properties
ModeBlock
A Boolean that determines whether CloudFront includes the mode=block directive in the X-XSS-Protection header.
public object? ModeBlock { get; set; }
Property Value
Remarks
For more information about this directive, see X-XSS-Protection in the MDN Web Docs.
Type union: either bool or IResolvable
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.
public object Override { get; set; }
Property Value
Remarks
Protection
A Boolean that determines the value of the X-XSS-Protection HTTP response header.
public object Protection { get; set; }
Property Value
Remarks
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 .
For more information about these settings, see X-XSS-Protection in the MDN Web Docs.
Type union: either bool or IResolvable
ReportUri
A reporting URI, which CloudFront uses as the value of the report directive in the X-XSS-Protection header.
public string? ReportUri { get; set; }
Property Value
Remarks
You cannot specify a ReportUri when ModeBlock is true .
For more information about using a reporting URL, see X-XSS-Protection in the MDN Web Docs.