Remove redundant respond_to?(:flush) guard in StreamableHTTPTransport
## Motivation and Context The stream object always responds to flush, so the conditional check is unnecessary. ## How Has This Been Tested? All existing tests are passing. ## Breaking Changes None.
This commit is contained in:
parent
2a1c9b7ac9
commit
1ddd26b10b
1 changed files with 2 additions and 2 deletions
|
|
@ -255,12 +255,12 @@ module MCP
|
|||
def send_to_stream(stream, data)
|
||||
message = data.is_a?(String) ? data : data.to_json
|
||||
stream.write("data: #{message}\n\n")
|
||||
stream.flush if stream.respond_to?(:flush)
|
||||
stream.flush
|
||||
end
|
||||
|
||||
def send_ping_to_stream(stream)
|
||||
stream.write(": ping #{Time.now.iso8601}\n\n")
|
||||
stream.flush if stream.respond_to?(:flush)
|
||||
stream.flush
|
||||
end
|
||||
|
||||
def handle_post(request)
|
||||
|
|
|
|||
Loading…
Reference in a new issue