ContentSecurityPolicy class
Configuration for Content-Security-Policy header.
Constructors
- ContentSecurityPolicy()
- Creates an empty CSP configuration.
- ContentSecurityPolicy.permissive()
-
Creates a permissive CSP (for development).
factory
- ContentSecurityPolicy.strict()
-
Creates a basic CSP that only allows same-origin resources.
factory
Properties
Methods
-
baseUri(
List< String> sources) → ContentSecurityPolicy - Sets the base-uri directive.
-
build(
) → String - Builds the CSP header value.
-
connectSrc(
List< String> sources) → ContentSecurityPolicy - Sets the connect-src directive.
-
defaultSrc(
List< String> sources) → ContentSecurityPolicy - Sets the default-src directive.
-
directive(
String name, List< String> values) → ContentSecurityPolicy - Sets a custom directive.
-
fontSrc(
List< String> sources) → ContentSecurityPolicy - Sets the font-src directive.
-
formAction(
List< String> sources) → ContentSecurityPolicy - Sets the form-action directive.
-
frameAncestors(
List< String> sources) → ContentSecurityPolicy - Sets the frame-ancestors directive.
-
frameSrc(
List< String> sources) → ContentSecurityPolicy - Sets the frame-src directive.
-
imgSrc(
List< String> sources) → ContentSecurityPolicy - Sets the img-src directive.
-
mediaSrc(
List< String> sources) → ContentSecurityPolicy - Sets the media-src directive.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
objectSrc(
List< String> sources) → ContentSecurityPolicy - Sets the object-src directive.
-
reportUri(
String uri) → ContentSecurityPolicy - Sets the report-uri directive.
-
scriptSrc(
List< String> sources) → ContentSecurityPolicy - Sets the script-src directive.
-
styleSrc(
List< String> sources) → ContentSecurityPolicy - Sets the style-src directive.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited