Skip to content

Fix double slash in Live WebSocket URL - #3434

Open
Sun-Wukhan wants to merge 2 commits into
googleapis:mainfrom
Sun-Wukhan:fix/live-websocket-double-slash
Open

Sun-Wukhan wants to merge 2 commits into
googleapis:mainfrom
Sun-Wukhan:fix/live-websocket-double-slash

Conversation

@Sun-Wukhan

Copy link
Copy Markdown

Fixes #3426

The Live WebSocket URL was built by joining the websocket base URL, which ends with a slash, with a path starting with /ws, producing a double slash (wss://generativelanguage.googleapis.com//ws/...).

This strips a single trailing slash in _websocket_base_url() in _api_client.py, which fixes the join for both Live and Live Music, which shares the same pattern. Five existing assertions in test_client_initialization.py that expected the trailing-slash return value are updated.

Tests: the targeted run of test_live.py, test_client_initialization.py and the transformers tests passes (279 passed). One failure, test_connect_keeps_client_base_url, also fails on unmodified upstream in this environment and is unrelated.

@Venkaiahbabuneelam Venkaiahbabuneelam self-assigned this Nov 30, 2026
@Venkaiahbabuneelam Venkaiahbabuneelam added the size:L Code changes between 40-100 lines label Nov 30, 2026
@Venkaiahbabuneelam

Copy link
Copy Markdown

Hi @Sun-Wukhan, Thanks for contributing!
Kindly please update the branch.
Thanks

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L Code changes between 40-100 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Live: WebSocket URL path starts with a double slash (//ws/...)

2 participants