(self, scope: Scope, receive: Receive, send: Send)
| 271 | return URLPath(path=path, protocol="http") |
| 272 | |
| 273 | async def handle(self, scope: Scope, receive: Receive, send: Send) -> None: |
| 274 | if self.methods and scope["method"] not in self.methods: |
| 275 | headers = {"Allow": ", ".join(self.methods)} |
| 276 | if "app" in scope: |
| 277 | raise HTTPException(status_code=405, headers=headers) |
| 278 | else: |
| 279 | response = PlainTextResponse("Method Not Allowed", status_code=405, headers=headers) |
| 280 | await response(scope, receive, send) |
| 281 | else: |
| 282 | await self.app(scope, receive, send) |
| 283 | |
| 284 | def __eq__(self, other: Any) -> bool: |
| 285 | return ( |
nothing calls this directly
no test coverage detected