httpPathHasRoute function

bool httpPathHasRoute(
  1. HttpRequest req
)

true when a route of any method matches the path of req. with MethodOverride, a POST to a path with no route at all is answered without reading its body.

Implementation

bool httpPathHasRoute(HttpRequest req) {
  Map<String, _MethodRoutes> index = _routeIndex();
  String? host = _hasDomain ? req.headers.value(HttpHeaders.hostHeader) : null;
  for (String method in index.keys) {
    if (_getMatchRoute(req.uri.path, method, host) != null) return true;
  }
  return false;
}