MCPcopy
hub / github.com/aio-libs/aiohttp / resolve

Method resolve

aiohttp/web_urldispatcher.py:722–738  ·  view source on GitHub ↗
(self, request)

Source from the content-addressed store, hash-verified

720
721 @asyncio.coroutine
722 def resolve(self, request):
723 path = request.raw_path
724 method = request.method
725 allowed_methods = set()
726
727 for resource in self._resources:
728 match_dict, allowed = yield from resource.resolve(method, path)
729 if match_dict is not None:
730 return match_dict
731 else:
732 allowed_methods |= allowed
733 else:
734 if allowed_methods:
735 return MatchInfoError(HTTPMethodNotAllowed(method,
736 allowed_methods))
737 else:
738 return MatchInfoError(HTTPNotFound())
739
740 def __iter__(self):
741 return iter(self._named_resources)

Callers

nothing calls this directly

Calls 4

MatchInfoErrorClass · 0.85
HTTPNotFoundClass · 0.85
resolveMethod · 0.45

Tested by

no test coverage detected