CorsPolicy class

The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing

Constructors

CorsPolicy()
CorsPolicy.fromJson(Map _json)

Properties

allowCredentials bool
In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. Default is false.
read / write
allowHeaders List<String>
Specifies the content for the Access-Control-Allow-Headers header.
read / write
allowMethods List<String>
Specifies the content for the Access-Control-Allow-Methods header.
read / write
allowOriginRegexes List<String>
Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript An origin is allowed if it matches either allow_origins or allow_origin_regex.
read / write
allowOrigins List<String>
Specifies the list of origins that will be allowed to do CORS requests. An origin is allowed if it matches either allow_origins or allow_origin_regex.
read / write
disabled bool
If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect.
read / write
exposeHeaders List<String>
Specifies the content for the Access-Control-Expose-Headers header.
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
maxAge int
Specifies how long results of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toJson() Map<String, Object>
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited