httprb/http
61.5
Adequate · 5 November 2026
8.4k
lines of production code
Ruby
primary language
4
measurements over time
What this system is
Features
Add JSON MIME type adapter
Introduces a new JSON adapter for the MIME type system, allowing users to encode Ruby objects to JSON strings and decode JSON strings back into Ruby objects. This includes a base adapter class and a concrete JSON implementation that registers itself for the 'application/json' MIME type and alias.
_lib/http/mime\type · high confidence
Added HTTP status reason phrase mapping
A new \REASONS\ constant has been added to \HTTP::Response::Status\, providing a comprehensive map of HTTP status codes to their standard reason phrases (e.g., 404 maps to "Not Found"). This allows users to programmatically retrieve the human-readable reason associated with a status code.
lib/http/response/status · high confidence
Added development console script
A new \bin/console\ script has been added to simplify local development and experimentation. This executable Ruby script sets up the bundler environment, loads the \http\ library, and launches an IRB session, allowing developers to quickly interact with the gem's code and dependencies without starting a full application.
bin · high confidence
Introduce HTTP::ContentType parsing and HTTP::FormData multipart support
The library now includes an HTTP::ContentType class that parses Content-Type headers to extract the MIME type and charset, and adds support for building multipart/form-data and application/x-www-form-urlencoded request bodies via the new HTTP::FormData module (including FormData::File for file uploads).
lib/http · high confidence
Introduces configurable timeout handlers for HTTP connections
The library now includes a timeout subsystem with three distinct strategies: a global timeout that applies a single time limit to the entire request, per-operation timeouts that allow separate limits for connection, read, and write phases, and a null handler that enforces no timeouts. These handlers manage non-blocking I/O using \IO::Wait\ and support native connect timeouts on Ruby 3.4+ for improved Happy Eyeballs (RFC 8305) compatibility, while also handling SSL handshake timeouts and socket closure gracefully.
lib/http/timeout · high confidence
New HTTP retry logic with configurable delays and Retry-After support
The HTTP library now includes a new retriable feature that automatically retries failed requests based on configurable parameters. This implementation introduces a new \OutOfRetriesError\ that exposes the last response and original cause for better debugging. The retry mechanism supports custom delay strategies, including parsing HTTP \Retry-After\ headers (both numeric seconds and RFC 2822 dates), exponential backoff with jitter, and custom predicates for determining which exceptions or status codes should trigger a retry.
lib/http/retriable · high confidence
New extensible features for HTTP compression, caching, authentication, and error handling
The HTTP client now supports a modular feature system that allows users to enable capabilities like automatic request body compression (AutoDeflate), automatic response decompression (AutoInflate), RFC 7234 HTTP caching, RFC 2617/7616 Digest Authentication, request/response logging, and automatic raising of errors for non-2xx responses. These features are registered with the options system and can be composed using \HTTP.use(:feature\_name)\, providing a cleaner API for common HTTP behaviors without modifying the core client logic.
lib/http/features · high confidence
Ship RBS type signatures for downstream consumers
This release includes RBS type signature files (sig/http.rbs, sig/deps.rbs, sig/llhttp.rbs) and a manifest (sig/manifest.yaml) to support static type checking for the HTTP gem. The signatures define the public API for HTTP, Session, and Client classes, including method signatures for verbs, options, and hooks, while also providing stubs for external dependencies like Addressable and llhttp-ffi, and overrides for standard library classes like StringIO and File to ensure compatibility with the gem's implementation.
sig · high confidence
Behavioural changes
Introduce streamable response body, gzip/deflate inflation, and LLHttp-based parsing
HTTP responses are now handled via a new \HTTP::Response::Body\ class that supports streaming reads via \readpartial\ and preserves content encoding, rather than eagerly loading the entire body. An \HTTP::Response::Inflater\ automatically decompresses gzip/deflate payloads when the connection enables auto-inflation. Under the hood, the library replaces the previous parser with \llhttp\ for faster HTTP response parsing, including a JRuby-specific fix to retain callback procs and prevent intermittent hangs. Additionally, \HTTP::Response::Status\ has been refactored to use \Comparable\ and \Forwardable\ instead of \Delegator\, providing better type safety and comparison capabilities.
lib/http/response · high confidence
Introduces canonical header name constants and a thread-safe normalizer
The library now provides a \HTTP::Headers::Known\ module containing constants for standard HTTP header names (such as \Accept-Encoding\, \Content-Type\, and \Authorization\) and the \CHUNKED\ transfer encoding value, replacing the need for magic strings. Additionally, a new \HTTP::Headers::Normalizer\ class has been added to convert header names into their canonical capitalized form (e.g., \content-type\ to \Content-Title\). This normalizer includes a thread-local cache to optimize performance and ensure thread safety during header processing.
lib/http/headers · high confidence
Library rebranded from Http to HTTP with new session-based API
The library has been renamed from the \Http\ module to \HTTP\ to align with standard naming conventions. This change introduces a new session-based architecture, replacing the previous flat module structure with distinct components like \HTTP::Session\, \HTTP::Client\, and \HTTP::Request\. Users can now utilize a chainable interface, such as \HTTP\[:accept =\> "text/html"\].get(...)\, which returns an \HTTP::Session\ object, marking a significant shift in how requests are constructed and executed.
lib · high confidence
New option definitions for HTTP client configuration
The HTTP client now exposes a new \lib/http/options/definitions.rb\ file that centralizes the configuration options for requests and clients. This change introduces explicit support for \base\_uri\ (allowing relative request paths to be resolved against a base) and \persistent\ connections (enabling connection reuse based on origin). It also refactors the \retriable\ option to be a session-level setting rather than a separate class hierarchy, and normalizes the \features\ hash to accept both symbols and hashes. Users can now configure these options directly when initializing the HTTP client.
lib/http/options · high confidence
Refactored HTTP verb methods and timeout configuration
The HTTP verb methods (get, post, put, delete, etc.) now accept keyword arguments instead of a single options hash, aligning with modern Ruby syntax. Additionally, the library introduces stricter parsing for timeout options, allowing users to combine global and per-operation timeouts via the new \resolve\_timeout\_hash\ helper, which normalizes these settings into the appropriate timeout classes.
lib/http/chainable · high confidence
Refactored request body handling and streaming architecture
The request body logic has been extracted into a dedicated \HTTP::Request::Body\ class, enabling explicit streaming support for IO objects and enumerables while ensuring IO streams are rewound after consumption. The \HTTP::Request::Builder\ now centralizes request construction, including the addition of a \Content-Length\ header based on the body's byte size and the neutralization of protocol-relative URIs to prevent resolution issues with base URIs. Additionally, the \HTTP::Request::Writer\ has been updated to handle chunked transfer encoding correctly and to stop writing immediately upon receiving an \EPIPE\ error, improving robustness during request transmission.
lib/http/request · high confidence
Reimplemented HTTP::URI with native component storage and optimized parsing
The HTTP::URI class has been rewritten to store URI components natively rather than relying on the Addressable gem for all operations. Parsing now uses the Ruby standard library for ASCII URIs (which is faster) and falls back to Addressable only when necessary for non-ASCII characters or when stdlib parsing fails. The normalizer has also been reimplemented to use native logic for dot-segment removal and component assembly, reducing dependency overhead and improving performance for common cases.
lib/http/uri · high confidence
Fixes
1 commit (1 fix) fixing duel
A fix in duel — 1 commit (1 fix), 7 files: “Add Duel performance regression guards”.
duel · medium confidence · unverified
Test coverage
Add mutation testing and type-checking tooling; Added Minitest test suite for HTTP timeout handling; Added comprehensive test coverage for HTTP request internals; Added comprehensive test suite for HTTP::Retriable components; Added test coverage for HTTP library features; Added test coverage for HTTP response body, parser, and status components; Added test suites for connection reuse and timeout handling; Added tests for HTTP::Headers::Normalizer thread safety and caching; Expanded test coverage for HTTP client components; Migrate test suite to Minitest; New custom test server implementation for HTTP testing; New test infrastructure for HTTP and SSL testing.
Dependencies
Upgrade to Ruby 3.2+ and modernize dependency stack
The library now requires Ruby 3.2 or later and has significantly updated its development and runtime dependencies. The Gemfile now pins RuboCop to version 1.85 (along with related plugins like rubocop-minitest and rubocop-performance) and switches the test suite to Minitest. Runtime dependencies have been updated to use the native \llhttp\ gem (\~\> 0.6.1) on MRI and \llhttp-ffi\ (\~\> 0.5.1) on JRuby, replacing older parser implementations. The gemspec has also been modernized with explicit license metadata, MFA requirements for publishing, and updated author information.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 60 → 62 (+1.3)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 100 → 97 (-2.8)
- Architecture 64 → 63 (-1.4)
- Maturity 46 → 51 (+4.4)
- Readiness 70 → 70 (+0.0)
- Security 91 → 87 (-4.3)
Resolved (4)
- Inconsistent naming for factory/conversion methods. URI.parse is a class method for construction from a string. Headers.coerce is a class method for construction from various objects. While coerce is often used for type conversion in Ruby (e.g., Numeric), parse is specific to parsing strings. If Headers.coerce is intended to be a general constructor, Headers.new or Headers.parse might be more consistent with URI.parse. However, coerce is a valid Ruby idiom for type conversion. This is acceptable.
- No genuine inconsistency found. merge and merge! follow standard Ruby Hash conventions.
- Off-boarding risk: anonymized user #1
- Redundant accessors for header retrieval. Headers.[] is the standard Ruby idiom for hash-like access, while get is a common alternative. Having both without clear distinction (e.g., one returning nil vs default) creates confusion.
New (7)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Medium: security finding (details withheld)
- Off-boarding risk: anonymized user #1
Changes since last survey
- 4 commits — 3 feature/other, 1 fixes
By area
- (root) — 4 commits
Notable commits
- fix: Add Duel performance regression guards
- change: Update Duel to 0.1.1
- change: Update Duel to 0.1.2
- change: Update Duel to 0.1.3
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
httprb/http was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 5 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 726495f20d9bc063f774e30846860494cc0630c9 — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.2+preprod-5c4e66d9318b.