APICrossOriginPolicies class

The cross-origin isolation policies of static file responses.

Configured at cross_origin/static_files. See APICrossOriginConfig.

Every policy accepts none (or an empty value) to omit its header.

Constructors

APICrossOriginPolicies({Object? openerPolicy, Object? embedderPolicy, Object? resourcePolicy})
APICrossOriginPolicies.fromJson(Map json)
factory
APICrossOriginPolicies.resolve({APIConfig? apiConfig, ArgsSimple? args})
Resolves from the cross_origin/static_files entry of apiConfig, overridden by the command-line options in args.
factory

Properties

embedderPolicy String
The Cross-Origin-Embedder-Policy (COEP) header, sent only for text/html responses. Disabled by default.
final
hashCode int
The hash code for this object.
no setterinherited
openerPolicy String
The Cross-Origin-Opener-Policy (COOP) header, sent only for text/html responses, since COOP applies to top-level documents.
final
resourcePolicy String
The Cross-Origin-Resource-Policy (CORP) header, sent for every static file response, since CORP is a per-resource header. Disabled by default.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

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

Static Methods

normalizePolicy(Object? value, String def) String
Normalizes a policy value: null resolves to def, while an empty value or the none sentinel resolves to '', omitting the header.

Constants

defaultEmbedderPolicy → const String
The default value for embedderPolicy: disabled.
defaultOpenerPolicy → const String
The default value for openerPolicy: same-origin-allow-popups.
defaultResourcePolicy → const String
The default value for resourcePolicy: disabled.
headerEmbedderPolicy → const String
The Cross-Origin-Embedder-Policy header name.
headerOpenerPolicy → const String
The Cross-Origin-Opener-Policy header name.
headerResourcePolicy → const String
The Cross-Origin-Resource-Policy header name.