CorsMiddleware constructor

CorsMiddleware({
  1. String allowOrigin = '*',
  2. String allowMethods = 'GET, POST, PUT, PATCH, DELETE, OPTIONS',
  3. String allowHeaders = 'Origin, Content-Type, Accept, Authorization, X-Requested-With',
  4. String? exposeHeaders,
  5. bool allowCredentials = false,
  6. int? maxAge = 86400,
})

Implementation

CorsMiddleware({
  this.allowOrigin = '*',
  this.allowMethods = 'GET, POST, PUT, PATCH, DELETE, OPTIONS',
  this.allowHeaders =
      'Origin, Content-Type, Accept, Authorization, X-Requested-With',
  this.exposeHeaders,
  this.allowCredentials = false,
  this.maxAge = 86400, // 24 hours
});