(
self, scope: dict, receive: Callable, send: Callable
)
| 438 | self.app = app |
| 439 | |
| 440 | async def __call__( |
| 441 | self, scope: dict, receive: Callable, send: Callable |
| 442 | ) -> None: |
| 443 | if scope["path"] != "/": |
| 444 | await send( |
| 445 | { |
| 446 | "type": "http.response.start", |
| 447 | "status": 401, |
| 448 | "headers": [(b"content-length", b"0")], |
| 449 | } |
| 450 | ) |
| 451 | await send( |
| 452 | { |
| 453 | "type": "http.response.body", |
| 454 | "body": b"", |
| 455 | "more_body": False, |
| 456 | } |
| 457 | ) |
| 458 | else: |
| 459 | await self.app(scope, receive, send) |
| 460 | |
| 461 | app.asgi_app = OddMiddleware(app.asgi_app) # type: ignore |
| 462 |