test(server): cover client disconnect during session establishment · sainikhiljuluri/python-sdk@ed73cf3 · GitHub
Skip to content

Commit ed73cf3

Browse files
test(server): cover client disconnect during session establishment
A client that disconnects mid-initialize never reaches the refusal paths: Request.body() raises ClientDisconnect, which _handle_post_request turns into a 500. The discard keys off the response status, so it covers this too. Pins that by name for both disconnect shapes. Reported by @keeltrace on modelcontextprotocol#3229. Also realigns with upstream modelcontextprotocol#3336, which moved RequestBodyLimitMiddleware and its replay tests into transport_security. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent f31c7f5 commit ed73cf3

2 files changed

Lines changed: 39 additions & 65 deletions

File tree

‎src/mcp/server/streamable_http_manager.py‎

Lines changed: 1 addition & 1 deletion

‎tests/server/test_streamable_http_manager.py‎

Lines changed: 38 additions & 64 deletions

0 commit comments

Comments
 (0)