Skip to content

fix(realtime): call .toString() on WebSocket url #1324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

jamonholmgren
Copy link
Contributor

The WebSocket spec at WHATWG indicates that the url parameter of the WebSocket constructor is a string. Some implementations (like Chrome) will accept a URL object, but calling .toString() should work for all cases.

Fixes #1323.

  • I understand that this repository is auto-generated and my pull request may not be merged

Sorry, something went wrong.

The [WebSocket spec at WHATWG](https://websockets.spec.whatwg.org/#ref-for-dom-websocket-websocket%E2%91%A0) indicates that the `url` parameter of the WebSocket constructor is a string. Some implementations (like Chrome) will accept a URL object, but calling .toString() should work for all cases.

Fixes openai#1323.
@jamonholmgren jamonholmgren requested a review from a team as a code owner February 13, 2025 01:34
@RobertCraigie RobertCraigie changed the title Call .toString() on WebSocket url fix(realtime): call .toString() on WebSocket url Feb 13, 2025
@RobertCraigie RobertCraigie changed the base branch from master to next February 13, 2025 13:25
Copy link
Collaborator

@RobertCraigie RobertCraigie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@RobertCraigie RobertCraigie merged commit 09bc50d into openai:next Feb 13, 2025
3 checks passed
@stainless-app stainless-app bot mentioned this pull request Feb 13, 2025
stainless-app bot pushed a commit that referenced this pull request Feb 13, 2025
The [WebSocket spec at WHATWG](https://websockets.spec.whatwg.org/#ref-for-dom-websocket-websocket%E2%91%A0) indicates that the `url` parameter of the WebSocket constructor is a string. Some implementations (like Chrome) will accept a URL object, but calling .toString() should work for all cases.

Fixes #1323.
@jamonholmgren jamonholmgren deleted the patch-1 branch April 30, 2025 14:33
@stainless-app stainless-app bot mentioned this pull request May 29, 2025
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.

Realtime WebSocket should ideally provide a String url instead of a URL instance for better compatibility
2 participants