Repository navigation
Do not truncate the URL path of IPC URLs at : - #2344
Merged
Merged
Conversation
The IPC path and the URL path of a `ws+unix:` URL are separated by the first `:`, but everything after a second `:` was dropped. For example, `ws+unix:/tmp/ws.sock:/foo:bar?baz=qux` resulted in a request for `/foo` instead of `/foo:bar?baz=qux`. Only the IPC path is documented as not being allowed to contain `:`, so keep the rest of the string as the URL path.
lpinca
reviewed
Oct 23, 2026
lpinca
approved these changes
Oct 23, 2026
Member
|
Thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a
ws+unix:URL has a:in the URL path or query string, everything after that:is silently dropped.initAsClient()splits on every:and keeps only the first two parts, so the server receives a different path than the one the client asked for.For example,
new WebSocket('ws+unix:/tmp/app.sock:/events?since=2026-10-23T10:00:00Z')sendsGET /events?since=2026-10-23T10andws+unix:/tmp/app.sock:/events/urn:uuid:42sendsGET /events/urn. Timestamps in the query string, URNs, and Kubernetes API proxy paths such as/api/v1/namespaces/default/pods/name:8080/proxy/(withkubectl proxy --unix-socket) all hit this.The IPC connections section of
doc/ws.mdsays that only the IPC path must not include:, so this change keeps everything after the first:as the URL path. When the URL path is omitted,opts.pathis now''instead ofundefined, andhttp.request()still defaults it to/(the existing IPC server test covers that case).Ran:
npm test(439 passing, 1 pending, same pending test as on master) andnpm run linton Node.js 24 on Windows.Checked: the new test fails on master with
'/foo'instead of'/foo:bar?baz=qux:quux', and an end-to-end check over a named pipe now receives/events/urn:uuid:42?since=2026-10-23T10:00:00Zunchanged.