HttpRouteCorsPolicy constructor

const HttpRouteCorsPolicy({
  1. Input<bool>? allowCredentials,
  2. Input<List<String>>? allowHeaders,
  3. Input<List<String>>? allowMethods,
  4. Input<List<String>>? allowOriginRegexes,
  5. Input<List<String>>? allowOrigins,
  6. Input<bool>? disabled,
  7. Input<List<String>>? exposeHeaders,
  8. Input<String>? maxAge,
})

Creates a new HttpRouteCorsPolicy. allowCredentials 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 value is false. allowHeaders Specifies the content for Access-Control-Allow-Headers header. allowMethods Specifies the content for Access-Control-Allow-Methods header. allowOriginRegexes Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax. allowOrigins Specifies the list of origins that will be allowed to do CORS requests. An origin is allowed if it matches either an item in allow_origins or an item in allow_origin_regexes. disabled If true, the CORS policy is disabled. The default value is false, which indicates that the CORS policy is in effect. exposeHeaders Specifies the content for Access-Control-Expose-Headers header. maxAge Specifies how long result of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.

Implementation

const HttpRouteCorsPolicy({
  this.allowCredentials,
  this.allowHeaders,
  this.allowMethods,
  this.allowOriginRegexes,
  this.allowOrigins,
  this.disabled,
  this.exposeHeaders,
  this.maxAge,
});