CorsOptions constructor

CorsOptions(
  1. {Iterable<String> allowedHeaders: const [],
  2. bool credentials,
  3. int maxAge,
  4. Iterable<String> methods: const ['GET', 'HEAD', 'PUT', 'PATCH', 'POST', 'DELETE'],
  5. dynamic origin: '*',
  6. int successStatus: 204,
  7. bool preflightContinue: false,
  8. Iterable<String> exposedHeaders: const []}
)

Implementation

CorsOptions(
    {Iterable<String> allowedHeaders = const [],
    this.credentials,
    this.maxAge,
    Iterable<String> methods = const [
      'GET',
      'HEAD',
      'PUT',
      'PATCH',
      'POST',
      'DELETE'
    ],
    this.origin = '*',
    this.successStatus = 204,
    this.preflightContinue = false,
    Iterable<String> exposedHeaders = const []}) {
  if (allowedHeaders != null) this.allowedHeaders.addAll(allowedHeaders);

  if (methods != null) this.methods.addAll(methods);

  if (exposedHeaders != null) this.exposedHeaders.addAll(exposedHeaders);
}