MCPcopy
hub / github.com/encode/uvicorn / send_500_response

Method send_500_response

uvicorn/protocols/http/h11_impl.py:441–456  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

439 self.on_response = lambda: None
440
441 async def send_500_response(self) -> None:
442 response_start_event: HTTPResponseStartEvent = {
443 "type": "http.response.start",
444 "status": 500,
445 "headers": [
446 (b"content-type", b"text/plain; charset=utf-8"),
447 (b"connection", b"close"),
448 ],
449 }
450 await self.send(response_start_event)
451 response_body_event: HTTPResponseBodyEvent = {
452 "type": "http.response.body",
453 "body": b"Internal Server Error",
454 "more_body": False,
455 }
456 await self.send(response_body_event)
457
458 # ASGI interface
459 async def send(self, message: ASGISendEvent) -> None:

Callers 1

run_asgiMethod · 0.95

Calls 1

sendMethod · 0.95

Tested by

no test coverage detected