Return HTTP status code 202 for notification initialized method
This commit is contained in:
parent
22a7db73fd
commit
4a65f62158
1 changed files with 33 additions and 0 deletions
|
|
@ -108,6 +108,8 @@ module MCP
|
|||
|
||||
if body["method"] == "initialize"
|
||||
handle_initialization(body_string, body)
|
||||
elsif body["method"] == MCP::Methods::NOTIFICATIONS_INITIALIZED
|
||||
handle_notification_initialized
|
||||
else
|
||||
handle_regular_request(body_string, session_id)
|
||||
end
|
||||
|
|
@ -185,6 +187,10 @@ module MCP
|
|||
[200, headers, [response]]
|
||||
end
|
||||
|
||||
def handle_notification_initialized
|
||||
[202, {}, []]
|
||||
end
|
||||
|
||||
def handle_regular_request(body_string, session_id)
|
||||
# If session ID is provided, but not in the sessions hash, return an error
|
||||
if session_id && !@sessions.key?(session_id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue