MCPcopy
hub / github.com/encode/starlette / handle

Method handle

starlette/routing.py:267–276  ·  starlette/routing.py::Route.handle
(self, scope: Scope, receive: Receive, send: Send)

Source from the content-addressed store, hash-verified

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 (

Callers

nothing calls this directly

Calls 3

HTTPExceptionClass · 0.90
PlainTextResponseClass · 0.90
appMethod · 0.45

Tested by

no test coverage detected