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

Method handle

starlette/routing.py:267–276  ·  view source on GitHub ↗
(self, scope: Scope, receive: Receive, send: Send)

Source from the content-addressed store, hash-verified

265 return URLPath(path=path, protocol="http")
266
267 async def handle(self, scope: Scope, receive: Receive, send: Send) -> None:
268 if self.methods and scope["method"] not in self.methods:
269 headers = {"Allow": ", ".join(self.methods)}
270 if "app" in scope:
271 raise HTTPException(status_code=405, headers=headers)
272 else:
273 response = PlainTextResponse("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