Skip to content

Improve error message on invalid headers #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 7, 2025

Conversation

wojtekmach
Copy link
Contributor

Ref: elixir-mint/mint#468

With this patch in Mint we now have:

iex> {:ok, conn} = Mint.HTTP2.connect(:https, "httpbin.org", 443) ; Mint.HTTP.request(conn, "GET", "/json", [{"accept", nil}], nil)
** (ArgumentError) expected header name/value to be strings, got: "accept"/nil
    (hpax 1.0.3) lib/hpax.ex:339: HPAX.validate_header/2
    (hpax 1.0.3) lib/hpax.ex:302: HPAX.encode_headers/3
    (elixir 1.18.4) lib/map.ex:999: Map.get_and_update!/3
    (mint 1.7.1) lib/mint/http2.ex:1134: Mint.HTTP2.encode_headers/4
    (mint 1.7.1) lib/mint/http2.ex:520: Mint.HTTP2.request/5
    iex:1: (file)

@coveralls
Copy link

coveralls commented Aug 7, 2025

Pull Request Test Coverage Report for Build 138451c6e3952dc77e541617d229a7e614bc0940-PR-24

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 95.808%

Totals Coverage Status
Change from base Build bbc9fe6d60a4a5313270792bdd02ee12536348f9: 0.08%
Covered Lines: 160
Relevant Lines: 167

💛 - Coveralls

@whatyouhide
Copy link
Contributor

Can we add a test for this @wojtekmach? Looks great otherwise

@whatyouhide whatyouhide merged commit 533832d into elixir-mint:main Aug 7, 2025
1 of 2 checks passed
@whatyouhide
Copy link
Contributor

Thanks @wojtekmach 💟

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.

3 participants