fix: guard Bearer header in WebSocket federation proxy for empty key
The source-inspection test correctly caught one remaining unguarded
Authorization header in the WS proxy additional_headers. Applied the
same 'if remote_key else {}' pattern as the other 4 federation endpoints.
This commit is contained in:
+1
-3
@@ -760,9 +760,7 @@ async def federation_terminal_ws_proxy(websocket: WebSocket, remote_id: int) ->
|
|||||||
async with websockets.connect(
|
async with websockets.connect(
|
||||||
ws_url,
|
ws_url,
|
||||||
subprotocols=[Subprotocol("tty")],
|
subprotocols=[Subprotocol("tty")],
|
||||||
additional_headers={"Authorization": f"Bearer {remote_key}"}
|
additional_headers={"Authorization": f"Bearer {remote_key}"} if remote_key else {},
|
||||||
if remote_key
|
|
||||||
else {},
|
|
||||||
) as remote_ws:
|
) as remote_ws:
|
||||||
|
|
||||||
async def client_to_remote() -> None:
|
async def client_to_remote() -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user