Repository navigation
fix(http): preserve binary download and stream output - #2778
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | adba7d0 | Commit Preview URL Branch Preview URL |
Oct 26 2026, 04:08 AM |
chaliy
marked this pull request as ready for review
October 26, 2026 04:32
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
What changed
curlpreserves HTTP response bytes when writing files or stdout, including shell redirection, pipelines, and decompressed responses.wget -O -now preserves bytes too. Curl write-out counts use output bytes rather than replacement-expanded UTF-8 text.Why
Binary downloads were decoded with
String::from_utf8_lossybefore reaching the filesystem or shell stream. Archives therefore failed to extract despite successful HTTP responses.Before / After
Before: gzip magic
1f 8b 08 00became1f ef bf bd 08 00; an 8-byte response was reported as 14 bytes. A downloaded gzip archive failed withinvalid gzip header.After: raw bytes, NULs, and invalid UTF-8 survive files/stdout/pipelines. The same archive extracts successfully, and byte counts remain exact.
Validation: all 6 new HTTP integration tests pass (5 reproduced failures before the fix; the HTTP-error preservation control already passed). HTTP-feature all-target Clippy, formatting, cargo-vet, 183 Python tooling tests, knowledge/docs/capability/workflow/changelog guards pass. Full local suite: 2,593 passed, 4 ignored, 4 unchanged process-cleanup fixtures failed on ESRCH-absence assertions; those also fail serially in this runner, and a representative assertion reproduces with the unchanged upstream HTTP implementation. CI must pass before merge.
Changelog: Unreleased fix entry.
Risk
Low. HTTP policy, transport limits, credentials, and error handling stay on their existing path. The change removes early text decoding and uses the existing byte-native stream representation. Tests include HTTP failures preserving an existing destination file.
Checklist