Skip to content

Commit c084197

Browse files
committed
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.
1 parent f4aab5c commit c084197

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/mcp/server/transports/streamable_http_transport.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,7 @@ def handle_delete(request)
156156

157157
session_id = request.env["HTTP_MCP_SESSION_ID"]
158158

159-
return [
160-
400,
161-
{ "Content-Type" => "application/json" },
162-
[{ error: "Missing session ID" }.to_json],
163-
] unless session_id
159+
return missing_session_id_response unless session_id
164160

165161
cleanup_session(session_id)
166162
success_response

0 commit comments

Comments
 (0)