Repository navigation
fix: complete HTTP responses ending with trailers - #75
Merged
Merged
Conversation
Treat response trailers as the end of a stream so synchronous and asynchronous requests complete and pooled connections remain reusable.
3 tasks done
Exercise pipelined, expired, and cancelled requests against a controlled HTTP server. Align the application version and changelog with the next patch release.
Keep OTP 25 available after the ubuntu-latest image migration. Move test listeners outside the default ephemeral port range and report bind failures without a startup timeout.
hjianbo
commented
Oct 22, 2026
hjianbo
commented
Oct 22, 2026
hjianbo
marked this pull request as ready for review
October 22, 2026 06:12
zmstone
approved these changes
Oct 22, 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.
Complete HTTP responses that end with trailers. Gun emits
gun_trailersinstead of a finalgun_datamessage; treating it as end-of-stream lets the existing response path return the initial headers and accumulated body and release the request slot. Trailer fields are not merged into the response headers, and the request API stays unchanged.Regression tests use a real HTTP server to cover empty and nonempty bodies, connection reuse, pipelined requests, late trailers after timeout, and cancellation without a subsequent callback. The three lifecycle cases use a server-side gate to control when trailers are sent. All five new regression cases fail with 0.7.8 and pass with the fix.
Set the application version to 0.7.9 and align the changelog. The previous metadata still declared 0.7.7, causing the version check to fail against the 0.7.8 tag on OTP 25–28.
CI follow-up: pin Ubuntu 24.04 so OTP 25 remains installable after the ubuntu-latest migration. Move test listeners above the default ephemeral port range, and report listener bind failures immediately instead of waiting for a startup timeout.
Validation: native rebar3 passes all 105 non-external tests on OTP 28.4.1-7, including the application metadata checks. Formatting, xref, and Dialyzer pass. The 14 Google/proxy-dependent tests were not all successful in this environment; CI covers the full suite on OTP 25–28. Additional EMQX integration checks cover fragmented and truncated trailers, connection closure, HTTP/2, OAuth2 refresh, and resource-manager recovery.