(scope: Scope)
| 1984 | |
| 1985 | |
| 1986 | def _is_frontend_navigation_request(scope: Scope) -> bool: |
| 1987 | route_path = get_route_path(scope) |
| 1988 | final_segment = route_path.rsplit("/", 1)[-1] |
| 1989 | if os.path.splitext(final_segment)[1]: |
| 1990 | return False |
| 1991 | request = Request(scope) |
| 1992 | wildcard_accepted = False |
| 1993 | html_rejected = False |
| 1994 | for media_type, quality in _iter_accept_media_types( |
| 1995 | request.headers.get("accept", "") |
| 1996 | ): |
| 1997 | if media_type in {"text/html", "application/xhtml+xml"}: |
| 1998 | if quality == 0: |
| 1999 | html_rejected = True |
| 2000 | else: |
| 2001 | return True |
| 2002 | elif media_type == "*/*" and quality != 0: |
| 2003 | wildcard_accepted = True |
| 2004 | return wildcard_accepted and not html_rejected |
| 2005 | |
| 2006 | |
| 2007 | class _FrontendRoute(BaseRoute): |
no test coverage detected
searching dependent graphs…