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_filesentry ofapiConfig, overridden by the command-line options inargs.factory
Properties
- embedderPolicy → String
-
The
Cross-Origin-Embedder-Policy(COEP) header, sent only fortext/htmlresponses. 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 fortext/htmlresponses, 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:nullresolves todef, while an empty value or thenonesentinel 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-Policyheader name. - headerOpenerPolicy → const String
-
The
Cross-Origin-Opener-Policyheader name. - headerResourcePolicy → const String
-
The
Cross-Origin-Resource-Policyheader name.