THRIFT-6110: Reject empty successful Ruby HTTP responses#3650
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Ruby Thrift::HTTPClientTransport to raise a Thrift::TransportException when an HTTP request succeeds (2xx) but returns no Thrift payload, avoiding downstream non-transport exceptions for empty responses.
Changes:
- Add an explicit empty-body check in
HTTPClientTransport#flushfor successful (2xx) responses. - Add RSpec coverage for both
204with no body and200with an empty body.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/rb/spec/http_client_spec.rb | Adds a spec asserting a typed transport exception is raised for 2xx responses with no payload. |
| lib/rb/lib/thrift/transport/http_client_transport.rb | Adds a guard to reject nil/empty successful HTTP response bodies before attempting to wrap them as an input buffer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4657c2f to
57a6589
Compare
This is a little bit sad. Wonder if I reached monthly quota and to get more reviews I will need to wait till the beginning of the next month. Edit: on the |
Code reviewFound 1 issue:
thrift/lib/rb/lib/thrift/transport/http_client_transport.rb Lines 57 to 61 in 4657c2f thrift/compiler/cpp/src/thrift/generate/t_rb_generator.cc Lines 1124 to 1130 in d2001f7 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
…l responses Client: rb Co-Authored-By: OpenAI Codex (GPT-5.6) <codex@openai.com>
57a6589 to
15d47d9
Compare

Return a typed transport error when
Thrift::HTTPClientTransportreceives a successful HTTP response without a Thrift payload.This handles both 204 responses with no body and 200 responses with an empty body, so callers no longer receive an unrelated
NoMethodErrorwhile normal responses and existing HTTP-status handling remain unchanged.[skip ci]anywhere in the commit message to free up build resources.