CorsPolicy class final

The specification for allowing client-side cross-origin requests. For more information about the W3C recommendation for cross-origin resource sharing (CORS), see Fetch API Living Standard.

Constructors

CorsPolicy({bool? allowCredentials, List<String> allowHeaders = const [], List<String> allowMethods = const [], List<String> allowOriginRegexes = const [], List<String> allowOrigins = const [], bool? disabled, List<String> exposeHeaders = const [], int? maxAge})
CorsPolicy.fromJson(Object? j)
factory

Properties

allowCredentials bool?
In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This field translates to the Access-Control-Allow-Credentials header.
final
allowHeaders List<String>
Specifies the content for the Access-Control-Allow-Headers header.
final
allowMethods List<String>
Specifies the content for the Access-Control-Allow-Methods header.
final
allowOriginRegexes List<String>
Specifies a regular expression that matches allowed origins. For more information, see regular expression syntax.
final
allowOrigins List<String>
Specifies the list of origins that is allowed to do CORS requests.
final
disabled bool?
If true, disables the CORS policy. The default value is false, which indicates that the CORS policy is in effect.
final
exposeHeaders List<String>
Specifies the content for the Access-Control-Expose-Headers header.
final
hashCode int
The hash code for this object.
no setterinherited
maxAge int?
Specifies how long results of a preflight request can be cached in seconds. This field translates to the Access-Control-Max-Age header.
final
qualifiedName String
The fully qualified name of this message, i.e., google.protobuf.Duration or google.rpc.ErrorInfo.
finalinherited
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() Object
toString() String
A string representation of this object.
override

Operators

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

Constants

fullyQualifiedName → const String