Skip to content
v2.278.0

ContentTypeOptionsProperty Struct ​

Determines whether CloudFront includes the X-Content-Type-Options HTTP response header with its value set to nosniff .

For more information about the X-Content-Type-Options HTTP response header, see X-Content-Type-Options in the MDN Web Docs.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudfront as cloudfront } from 'aws-cdk-lib';
const contentTypeOptionsProperty: cloudfront.CfnResponseHeadersPolicy.ContentTypeOptionsProperty = {
  override: false,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cloudfront as cloudfront

content_type_options_property = cloudfront.CfnResponseHeadersPolicy.ContentTypeOptionsProperty(
    override=False
)
java
// 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.*;

ContentTypeOptionsProperty contentTypeOptionsProperty = ContentTypeOptionsProperty.builder()
        .override(false)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// 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 contentTypeOptionsProperty = new ContentTypeOptionsProperty {
    Override = false
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

contentTypeOptionsProperty := &ContentTypeOptionsProperty{
	Override: jsii.Boolean(false),
}

Properties ​

overrideboolean | IResolvableoverridetyping.Union[bool, IResolvable]overrideBooleanOverrideboolOverrideinterface{} required #
A Boolean that determines whether CloudFront overrides the `X-Content-Type-Options` HTTP response header received from the origin with the one specified in this response headers policy.