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