Use missing_session_id_response method in handle_delete

## Motivation and Context

`handle_delete` had an inline error response for "Missing session ID" that
was identical to the existing `missing_session_id_response` helper method.
`handle_get` already uses this helper for the same purpose.

## How Has This Been Tested?

All existing tests pass. The behavior is unchanged.

## Breaking Change

None.
This commit is contained in:
Koichi ITO 2026-03-18 12:10:56 +09:00
commit 75d03f334e

View file

@ -154,13 +154,7 @@ module MCP
return success_response
end
session_id = request.env["HTTP_MCP_SESSION_ID"]
return [
400,
{ "Content-Type" => "application/json" },
[{ error: "Missing session ID" }.to_json],
] unless session_id
return missing_session_id_response unless (session_id = request.env["HTTP_MCP_SESSION_ID"])
cleanup_session(session_id)
success_response