Skip to content

Commit 999f8b3

Browse files
committed
Refactor handle_delete to use extract_session_id
## Motivation and Context `handle_post` and `handle_get` already use this helper, but `handle_delete` inlined `request.env["HTTP_MCP_SESSION_ID"]`. This aligns all three handlers consistently. ## How Has This Been Tested? It has passed existing tests. ## Breaking Changes None.
1 parent d17cc51 commit 999f8b3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/mcp/server/transports/streamable_http_transport.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ def handle_delete(request)
426426
return success_response
427427
end
428428

429-
return missing_session_id_response unless (session_id = request.env["HTTP_MCP_SESSION_ID"])
429+
return missing_session_id_response unless (session_id = extract_session_id(request))
430430
return session_not_found_response unless session_exists?(session_id)
431431

432432
protocol_version_error = validate_protocol_version_header(request)

0 commit comments

Comments
 (0)