Skip to content

reverseproxy: Use correct cases for websocket related headers - #6621

Merged
francislavoie merged 4 commits into
masterfrom
websocket-normalize
Oct 11, 2024
Merged

francislavoie merged 4 commits into
masterfrom
websocket-normalize

Conversation

@WeidiDeng

@WeidiDeng WeidiDeng commented Oct 11, 2024 •

Copy link
Copy Markdown
Member

Fix https://caddy.community/t/websockets-fail-venus-os-cerbo-gx-victron/25685

Although websocket related headers should be handled case insensitively. Some legacy servers and clients do handle them strictly according to rfc. traefik handles this case too. Popular golang websocket libraries such as gorilla also use the correct case.

@francislavoie francislavoie changed the title use correct cases for websocket related headers reverseproxy: Use correct cases for websocket related headers Oct 11, 2024
@francislavoie francislavoie added the bug 🐞 Something isn't working label Oct 11, 2024
@francislavoie francislavoie added this to the v2.9.0-beta.3 milestone Oct 11, 2024

@francislavoie francislavoie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks perfect to me. I did a commit to adjust the wording a bit.

@francislavoie
francislavoie enabled auto-merge (squash) October 11, 2024 08:49
@francislavoie
francislavoie merged commit 48ce47f into master Oct 11, 2024
@francislavoie
francislavoie deleted the websocket-normalize branch October 11, 2024 09:02
mholt pushed a commit that referenced this pull request Dec 20, 2024
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
@BrewTestBot BrewTestBot mentioned this pull request Dec 31, 2024
1 task done
mohammed90 pushed a commit to cedricziel/caddy that referenced this pull request Aug 29, 2025
nfreya added a commit to nfreya/caddy that referenced this pull request Aug 5, 2026
A regression since caddyserver#6621, these headers can be rewritten by cloneHeaders
and by .Add from user and transport ops. Moving this closer to where
it's round-tripped feels like the nicest solution.

I've put the harness I used to reproduce the issue at
  https://codeberg.org/nfreya/caddy-websocket-headers-repro
nfreya added a commit to nfreya/caddy that referenced this pull request Aug 23, 2026
A regression since caddyserver#6621, these headers can be rewritten by cloneHeaders
and by .Add from user and transport ops. Moving this closer to where
it's round-tripped feels like the nicest solution.

I've put the harness I used to reproduce the issue at
  https://codeberg.org/nfreya/caddy-websocket-headers-repro
mholt added a commit that referenced this pull request Sep 23, 2026
* Move websocket header normalization later

A regression since #6621, these headers can be rewritten by cloneHeaders
and by .Add from user and transport ops. Moving this closer to where
it's round-tripped feels like the nicest solution.

I've put the harness I used to reproduce the issue at
  https://codeberg.org/nfreya/caddy-websocket-headers-repro

* Integration test for normalized websocket headers

---------

Co-authored-by: Zen Dodd <mail@steadytao.com>
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐞 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants