(
self, fallback: str, scope: Scope, *, status_code: int
)
| 1952 | return stat_result is not None and stat.S_ISREG(stat_result.st_mode) |
| 1953 | |
| 1954 | async def _fallback_response( |
| 1955 | self, fallback: str, scope: Scope, *, status_code: int |
| 1956 | ) -> Response: |
| 1957 | full_path, stat_result = await run_in_threadpool(self.lookup_path, fallback) |
| 1958 | if stat_result is None or not stat.S_ISREG(stat_result.st_mode): |
| 1959 | raise RuntimeError( |
| 1960 | f"Frontend fallback file '{fallback}' does not exist in " |
| 1961 | f"directory '{self.directory}'. Resolved absolute directory: " |
| 1962 | f"'{self._get_resolved_directory()}'" |
| 1963 | ) |
| 1964 | return self.file_response( |
| 1965 | full_path, stat_result, scope, status_code=status_code |
| 1966 | ) |
| 1967 | |
| 1968 | |
| 1969 | def _iter_accept_media_types(accept: str) -> Iterator[tuple[str, float]]: |
no test coverage detected