Skip to content

Commit 75d03f3

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 75d03f3

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/mcp/server/transports/streamable_http_transport.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,7 @@ def handle_delete(request)
154154
return success_response
155155
end
156156

157-
session_id = request.env["HTTP_MCP_SESSION_ID"]
158-
159-
return [
160-
400,
161-
{ "Content-Type" => "application/json" },
162-
[{ error: "Missing session ID" }.to_json],
163-
] unless session_id
157+
return missing_session_id_response unless (session_id = request.env["HTTP_MCP_SESSION_ID"])
164158

165159
cleanup_session(session_id)
166160
success_response

0 commit comments

Comments
 (0)