feat: Expand version support for http.rb v6#82
Merged
Conversation
This commit adds support for http.rb v6 while maintaining backward compatibility with v4 and v5. The http.rb v6 release changed from accepting an options hash to requiring keyword arguments for the HTTP::Client constructor and related methods. Key changes: - Update gemspec to allow http.rb versions up to 7.0.0 - Add VALID_HTTP_CLIENT_OPTIONS constant to filter options passed to HTTP::Client, preventing errors from unsupported options - Convert all HTTP client option keys from strings to symbols - Update HTTP::Client initialization and method calls to use keyword arguments (**options) instead of hash arguments - Add EOFError handling for improved connection cleanup in v6 - Add comprehensive test coverage for options filtering The filtering mechanism ensures that only valid HTTP client options are passed through, which is particularly important for maintaining backward compatibility when custom http_client_options are provided.
keelerm84
commented
Mar 24, 2026
| # TODO(breaking): Remove this filtering once we have updated to the next major breaking version. | ||
| # HTTP v6 requires keyword arguments instead of an options hash, so we filter to only known valid | ||
| # arguments to avoid passing unsupported options. | ||
| VALID_HTTP_CLIENT_OPTIONS = %i[ |
Member
Author
There was a problem hiding this comment.
@jsonbailey here is the approach we were discussing.
The only issue I found was that v4 and v5 support cookies as a parameter, but v6 dropped that. I don't include cookies in the list of allowable options since it would hard break in v6. However, I do log whenever we drop an option. Maybe that's a sufficient middle ground?
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
jsonbailey
approved these changes
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This commit adds support for http.rb v6 while maintaining backward
compatibility with v4 and v5. The http.rb v6 release changed from
accepting an options hash to requiring keyword arguments for the
HTTP::Client constructor and related methods.
Key changes:
HTTP::Client, preventing errors from unsupported options
arguments (**options) instead of hash arguments
The filtering mechanism ensures that only valid HTTP client options
are passed through, which is particularly important for maintaining
backward compatibility when custom http_client_options are provided.
Note
Medium Risk
Moderate risk because it changes how
HTTP::Clientis constructed and invoked (hash -> keyword args) and alters option handling, which could affect connection/proxy/timeout behavior across http.rb versions.Overview
Adds support for
httpgem v6 (while keeping v4/v5 compatibility) by allowing versions< 7.0.0, switchingHTTP::Client.newandrequestcalls to keyword arguments, and normalizing timeouts to floats.Introduces a
VALID_HTTP_CLIENT_OPTIONSallowlist that symbol-izes and filtershttp_client_options(warning on ignored keys), applies timeouts only when set, and treatsEOFErrorduring streaming reads as a clean disconnect.Extends specs with new coverage to ensure option filtering works for string/symbol keys, ignores unknown options without raising, and preserves known options.
Written by Cursor Bugbot for commit 00aa2b0. This will update automatically on new commits. Configure here.