INNER CODE UNIT · Python

__init__

MakazhanAlpamys/Soup · src/soup_cli/ui/app.py:146

    def __init__(
        self,
        app,
        headers: Mapping[str, str] = SECURITY_HEADERS,
        policy_exempt_paths: frozenset = frozenset(),
    ) -> None:
        self._app = app
        self._headers = tuple(
            (name.lower().encode("latin-1"), value.encode("latin-1"))
            for name, value in headers.items()
        )
        self._policy_exempt_paths = policy_exempt_paths

    async def __call__(self, scope, receive, send) -> None:
        if scope.get("type") != "http":
            await self._app(scope, receive, send)
            return

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…