isPreflightRequest property Null safety

bool isPreflightRequest

Whether or not this is a CORS preflight request.

This is true if the request HTTP method is OPTIONS and the headers contains Access-Control-Request-Method.

Implementation

bool get isPreflightRequest {
  return isCORSRequest &&
      raw.method == "OPTIONS" &&
      raw.headers.value("access-control-request-method") != null;
}