APICrossOriginConfig class
The cross-origin configuration of an APIServer.
Configured at the cross_origin entry of the APIConfig, split by the
kind of response it applies to, mirroring the cache entry:
cross_origin:
api:
allow_origin: ''
allow_credentials: true
static_files:
opener_policy: 'same-origin-allow-popups'
The two groups never apply to the same response: static files are served
without CORS headers, and the cross-origin isolation policies are
document headers, meaningless on an API payload.
Constructors
- APICrossOriginConfig({APICORSConfig? api, APICrossOriginPolicies? staticFiles})
- APICrossOriginConfig.fromJson(Map json)
-
factory
- APICrossOriginConfig.resolve({APIConfig? apiConfig, ArgsSimple? args})
-
Resolves from the
cross_originentry ofapiConfig, overridden by the command-line options inargs.factory
Properties
- api → APICORSConfig
-
The
CORSconfiguration of API responses. See APICORSConfig.final - hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- staticFiles → APICrossOriginPolicies
-
The cross-origin isolation policies of static file responses.
See APICrossOriginPolicies.
final
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