| 469 | return getattr(self.app, "routes", []) |
| 470 | |
| 471 | def matches(self, scope: Scope) -> tuple[Match, Scope]: |
| 472 | if scope["type"] in ("http", "websocket"): # pragma:no branch |
| 473 | headers = Headers(scope=scope) |
| 474 | host = headers.get("host", "").split(":")[0] |
| 475 | match = self.host_regex.match(host) |
| 476 | if match: |
| 477 | matched_params = match.groupdict() |
| 478 | for key, value in matched_params.items(): |
| 479 | matched_params[key] = self.param_convertors[key].convert(value) |
| 480 | path_params = dict(scope.get("path_params", {})) |
| 481 | path_params.update(matched_params) |
| 482 | child_scope = {"path_params": path_params, "endpoint": self.app} |
| 483 | return Match.FULL, child_scope |
| 484 | return Match.NONE, {} |
| 485 | |
| 486 | def url_path_for(self, name: str, /, **path_params: Any) -> URLPath: |
| 487 | if self.name is not None and name == self.name and "path" in path_params: |