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.
This commit is contained in:
Koichi ITO 2026-03-19 01:42:57 +09:00
commit 999f8b3f39

View file

@ -426,7 +426,7 @@ module MCP
return success_response
end
return missing_session_id_response unless (session_id = request.env["HTTP_MCP_SESSION_ID"])
return missing_session_id_response unless (session_id = extract_session_id(request))
return session_not_found_response unless session_exists?(session_id)
protocol_version_error = validate_protocol_version_header(request)