ContentSecurityPolicyOptions class

Options for the Content Security Policy middleware.

Constructors

ContentSecurityPolicyOptions({required bool useDefaults, required bool reportOnly, required Directive directives, required bool dangerouslyDisableDefaultSrc})
const
ContentSecurityPolicyOptions.dangerouslyDisableDefaultSrc({bool useDefaults = true, bool reportOnly = false, Map<String, List<String>?> directives = const {}})
Preconfigured options for disabling the Default Src which is dangerous.
const
ContentSecurityPolicyOptions.useDefaults({bool useDefaults = true, bool reportOnly = false, Map<String, List<String>?> directives = const {}})
Preconfigured options for the default CSP policy.
const

Properties

dangerouslyDisableDefaultSrc bool
final
directives Directive
final
hashCode int
The hash code for this object.
no setterinherited
reportOnly bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
useDefaults bool
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

getDefaultDirectives → const Map<String, List<String>?>
Default CSP policy directives.