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:
1 parent
be04a6cf90
commit
f21fdfd729
3 files changed
+44
-25
No files matched your search
+1
-1
@@ -237,7 +237,7 @@ pub async fn terminal(
|
||||
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"));
|
||||
}
|
||||
member_of(&state, &room, &user.user.id)?;
|
||||
|
||||
Reference in new issue
Block a user