Skip to content

Support processing HTTP/1.1 headers as they arrive - #499

Open
gdwoolbert3 wants to merge 1 commit into
elixir-mint:mainfrom
gdwoolbert3:stream-http1-headers
Open

Support processing HTTP/1.1 headers as they arrive#499
gdwoolbert3 wants to merge 1 commit into
elixir-mint:mainfrom
gdwoolbert3:stream-http1-headers

Conversation

@gdwoolbert3

@gdwoolbert3 gdwoolbert3 commented Aug 10, 2026

Copy link
Copy Markdown

Introduction

This is my attempt at implementing the feature requested in Issue 452.

The motivating for the change was the X-ClickHouse-Progress header system used by the ClickHouse HTTP interface (which I strongly suspect was the reason behind the aforementioned issue).

Implementation

This PR adds a new :stream_headers option for HTTP/1.1 connections that allows headers and trailers to be emitted as responses as soon as they're available instead of buffering them until they've all arrived. A few nuances about enabling this feature:

  • All complete headers from a single chunk are emitted at the same time
  • It's theoretically possible to receive NO :headers responses for a given request whereas, when not streaming headers, an empty list would be emitted. This change is explicitly laid out in the Mint.HTTP documentation.

This feature is opt-in, meaning there should be no changes for existing users.

Tesing

All existing tests pass and new stream headers tests were added to the HTTP/1.1 connection test module.

Open to any and all feedback 馃槂

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