(self, scope: Scope, path: str)
| 2027 | return self.matches_with_path(scope, self.path) |
| 2028 | |
| 2029 | def matches_with_path(self, scope: Scope, path: str) -> tuple[Match, Scope]: |
| 2030 | if scope["type"] != "http": |
| 2031 | return Match.NONE, {} |
| 2032 | frontend_path = self._get_frontend_path(path, get_route_path(scope)) |
| 2033 | if frontend_path is None: |
| 2034 | return Match.NONE, {} |
| 2035 | child_scope = { |
| 2036 | _FASTAPI_SCOPE_KEY: { |
| 2037 | _FASTAPI_FRONTEND_PATH_KEY: frontend_path, |
| 2038 | _FASTAPI_FRONTEND_SPECIFICITY_KEY: _frontend_path_specificity(path), |
| 2039 | } |
| 2040 | } |
| 2041 | if scope["method"] not in self.methods: |
| 2042 | return Match.PARTIAL, child_scope |
| 2043 | return Match.FULL, child_scope |
| 2044 | |
| 2045 | def _get_frontend_path(self, path: str, route_path: str) -> str | None: |
| 2046 | if path == "/": |
no test coverage detected