oauth2-proxy/pkg
Pascal 1d6721f7ba
fix: WebSocket proxy to respect PassHostHeader setting (#3290)
* Fix WebSocket proxy to respect PassHostHeader setting

When PassHostHeader is set to false, the regular HTTP proxy correctly
sets the Host header to the upstream backend URL. However, the WebSocket
proxy was not respecting this setting, causing WebSocket connections to
fail when backend services validate the Host header.

This commit:
- Adds passHostHeader parameter to newWebSocketReverseProxy()
- Applies setProxyUpstreamHostHeader() when PassHostHeader=false
- Ensures consistent behavior between HTTP and WebSocket proxies

Fixes #3288

Signed-off-by: Pascal Schmiel <pascal.schmiel@gmail.com>

* chore(): add tests, update changelog

Signed-off-by: Pascal Schmiel <pascal.schmiel@gmail.com>

---------

Signed-off-by: Pascal Schmiel <pascal.schmiel@gmail.com>
2026-01-16 20:30:16 +01:00
..
apis fix: added conditional so default is not always set and env vars are honored #3303 (#3304) 2026-01-14 22:18:52 +01:00
app chore(lint): fix staticcheck issues (#3061) 2025-05-26 12:29:34 +02:00
authentication fix: hmacauth dependency licensing issue (#3253) 2025-11-09 20:14:54 +01:00
cookies test: replace mock pkg/clock with narrowly targeted stub clocks. (#3238) 2025-10-28 10:05:02 +01:00
encryption fix alpha config 2025-11-16 22:38:40 +01:00
header revert: secrets as []byte instead of string 2025-11-16 22:38:42 +01:00
ip feat: add CF-Connecting-IP as supported real ip header (#2821) 2024-11-04 23:28:08 +01:00
logger Request ID Logging (#1087) 2021-03-21 18:20:57 +00:00
middleware feat: migrate google used organization id and header normalization booleans to pointers 2025-11-16 22:39:01 +01:00
providers fix: NewRemoteKeySet is not using DefaultHTTPClient (#3197) 2025-11-11 21:08:08 +01:00
proxyhttp chore(deps): update dependency golangci/golangci-lint to v2.7.2 (#3254) 2026-01-04 10:23:26 +01:00
requests use official upstream yaml library v3 2025-11-16 22:38:22 +01:00
sessions fix: use GetSecret() in ticket.go makeCookie to respect cookie-secret-file (#3228) 2025-10-28 08:37:25 +01:00
upstream fix: WebSocket proxy to respect PassHostHeader setting (#3290) 2026-01-16 20:30:16 +01:00
util refactor: ptr.Ptr to ptr.To 2025-11-16 22:38:59 +01:00
validation refactor: ptr.Ptr to ptr.To 2025-11-16 22:38:59 +01:00
version feat: Replace default Go user-agent with oauth2-proxy and version (#2570) 2024-07-14 21:09:17 +01:00
watcher Fix Linting Errors (#1835) 2022-10-21 11:57:51 +01:00