Skip to content

Return response headers from request_to_file in httpc adapter#175

Merged
ericmj merged 1 commit intomainfrom
ericmj/fix-request-to-file-headers
Apr 9, 2026
Merged

Return response headers from request_to_file in httpc adapter#175
ericmj merged 1 commit intomainfrom
ericmj/fix-request-to-file-headers

Conversation

@ericmj
Copy link
Copy Markdown
Member

@ericmj ericmj commented Apr 9, 2026

The httpc {stream, Filename} option discards response headers and status code, returning only {ok, saved_to_file} for 2xx responses. This meant callers never received headers like etag, breaking conditional download support.

Use async streaming ({stream, self}) instead, which delivers headers in stream_start while still streaming body chunks to disk without loading the full response into memory.

The httpc {stream, Filename} option discards response headers and
status code, returning only {ok, saved_to_file} for 2xx responses.
This meant callers never received headers like etag, breaking
conditional download support.

Use async streaming ({stream, self}) instead, which delivers headers
in stream_start while still streaming body chunks to disk without
loading the full response into memory.
@ericmj ericmj merged commit 410cba0 into main Apr 9, 2026
9 of 10 checks passed
@ericmj ericmj deleted the ericmj/fix-request-to-file-headers branch April 9, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant