fix: accept either the page host or the public url

An upstream proxy may rewrite Host to its own address. Keep the
configured public_url as a fallback so the terminal and presence
sockets still pass in that setup, while the Host check covers localhost
and LAN addresses.
This commit is contained in:
vhaudiquet committed 2026-11-28 02:19:44 +01:00
1 parent be04a6cf90
commit f21fdfd729
3 files changed
+44 -25

No files matched your search

+1 -1
View File
@@ -220,7 +220,7 @@ pub async fn presence(
headers: HeaderMap,
ws: WebSocketUpgrade,
) -> AppResult<Response> {
if !super::websocket_origin_ok(&headers) {
if !super::websocket_origin_ok(&state.config, &headers) {
return Err(AppError::forbidden("websocket origin does not match"));
}
let member = member_of(&state, &room, &user.user.id)?;