private function cors($request)
  {
    $origin  = $request->server->http_origin;
    $allowed = Config::get('cors.allowedOrigins');

    if (in_array('*', $allowed) || in_array($origin, $allowed) ) {
      $this->withHeaders($request);
    }
  }