match method

bool match(
  1. String method,
  2. String path
)

Implementation

bool match(String method, String path) {
  final regExp = pathToRegExp(this.path);
  final pathMatch = regExp.hasMatch(path);
  if (this.method == '*') {
    return pathMatch;
  } else {
    final methodMatch = this.method == method.toUpperCase();
    return methodMatch && pathMatch;
  }
}