cors static method

void cors({
  1. String allowOrigin = '*',
  2. String allowMethods = 'GET, POST, PUT, DELETE, OPTIONS',
  3. String allowHeaders = 'Content-Type, Authorization',
})

Set CORS headers

Implementation

static void cors({
  String allowOrigin = '*',
  String allowMethods = 'GET, POST, PUT, DELETE, OPTIONS',
  String allowHeaders = 'Content-Type, Authorization',
}) {
  response.header('Access-Control-Allow-Origin', allowOrigin);
  response.header('Access-Control-Allow-Methods', allowMethods);
  response.header('Access-Control-Allow-Headers', allowHeaders);
}