Skip to content

Fix double slash in Live WebSocket URL - #3434

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

Sun-Wukhan wants to merge 1 commit 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.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant