fix(core): strip trailing slash from companionUrl for socket URL - #6391
fix(core): strip trailing slash from companionUrl for socket URL#6391JammingBen wants to merge 3 commits into
Conversation
🦋 Changeset detectedLatest commit: 2608105 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
how did you reproduce this? how did you get the trailing slash? also, would it be possible to sign your commits, as we require all commits to be signed? |
3a8ebf7 to
3302f28
Compare
I passed a
Yep I just pushed again, should be signed now. |
|
note to self: look into whether we can validate it early instead, and give an error if a trailing slash is passed |
…t urls Move RequestClient's private stripSlash into a shared stripTrailingSlash util so the websocket URL and the HTTP URLs normalize identically, and strip repeated trailing slashes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mifi
left a comment
There was a problem hiding this comment.
The socket URL now goes through the same shared stripTrailingSlash helper as the HTTP URLs (and strips repeated slashes) rather than erroring on a trailing slash, because RequestClient.hostname has always silently tolerated one for every HTTP endpoint — so validating would break apps that work fine today, in a patch release.
A trailing slash produced
ws://host//api/<token>, which Companion's router rejects, so remote uploads hung until the socket timeout. Strip it to make the implementation more robust.