CorsPolicyResponse

data class CorsPolicyResponse(val allowCredentials: Boolean, val allowHeaders: List<String>, val allowMethods: List<String>, val allowOriginRegexes: List<String>, val allowOrigins: List<String>, val disabled: Boolean, val exposeHeaders: List<String>, val maxAge: Int)

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

Link copied to clipboard
fun CorsPolicyResponse(allowCredentials: Boolean, allowHeaders: List<String>, allowMethods: List<String>, allowOriginRegexes: List<String>, allowOrigins: List<String>, disabled: Boolean, exposeHeaders: List<String>, maxAge: Int)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

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. Default is false.

Link copied to clipboard

Specifies the content for the Access-Control-Allow-Headers header.

Link copied to clipboard

Specifies the content for the Access-Control-Allow-Methods header.

Link copied to clipboard

Specifies a regular expression that matches allowed origins. For more information about the regular expression syntax, see Syntax. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED.

Link copied to clipboard

Specifies the list of origins that is allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.

Link copied to clipboard

If true, the setting specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect.

Link copied to clipboard

Specifies the content for the Access-Control-Expose-Headers header.

Link copied to clipboard
val 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.