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:
Brian Krabach
2026-04-06 06:16:10 -07:00
parent 4beffc2cf9
commit d10c3b0088
+1 -3
View File
@@ -760,9 +760,7 @@ async def federation_terminal_ws_proxy(websocket: WebSocket, remote_id: int) ->
async with websockets.connect(
ws_url,
subprotocols=[Subprotocol("tty")],
additional_headers={"Authorization": f"Bearer {remote_key}"}
if remote_key
else {},
additional_headers={"Authorization": f"Bearer {remote_key}"} if remote_key else {},
) as remote_ws:
async def client_to_remote() -> None: