Skip to content

Allow conventional casing for picky WS server - #41

Merged
whatyouhide merged 1 commit into
elixir-mint:mainfrom
dbernheisel:dbern/case-sensitive-headers
Aug 12, 2026
Merged

Allow conventional casing for picky WS server#41
whatyouhide merged 1 commit into
elixir-mint:mainfrom
dbernheisel:dbern/case-sensitive-headers

Conversation

@dbernheisel

@dbernheisel dbernheisel commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

I'm writing a client for a websocket server that requires case-sensitive headers when upgrading (I realize that's against spec, but it's not a server I have control over).

Right now, Mint.WebSocket.upgrade(conn, ...) always sends downcased headers, but also, Mint always downcases headers.

However, if I create a new Mint connection with case_sensitive_headers: true then they're indeed kept as-is, but MintWebSocket still tries to upgrade the conn with downcased headers.

Therefore, this PR simply ProperCases the headers, for which Mint will downcase for everyone except those that specify case_sensitive_headers: true.

@whatyouhide
whatyouhide merged commit 6916165 into elixir-mint:main Aug 12, 2026
3 checks passed
@the-mikedavis

Copy link
Copy Markdown
Collaborator

Makes sense to me, thanks!

@whatyouhide

Copy link
Copy Markdown
Collaborator

This is out since yday on Hex btw!

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