You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Align WS and HTTP transports on a default /capability path (#1515)
Both transports now apply the default path when (and only when) the caller didn't supply one. Before this commit WS required the caller to spell `/capability` out (`connect('ws://host:9000')` silently failed against a default server) and HTTP did the opposite (it hardcoded `/capability/<kind>/<name>` so `connect('http://host:9001/capability')` silently double-prefixed and 404'd). Pure addition: existing `connect('ws://host:9000/capability')` and `connect('http://host:9001')` callers see byte-identical request URLs.
- `web/client.js`: new `_normaliseWsPath()` wired into `_resolveUrls()` for both URL forms; `_HttpLink.constructor` only appends `/capability` when the URL doesn't already end with it; `_fetch()` builds URLs from the normalised baseUrl with no hardcoded literal. `RosClient` JSDoc + matching `web/index.d.ts` updated to drop the spell-it-out examples and document the "pass an explicit non-default path" escape hatch for path-rewriting proxies.
- `test/test-web-ws.js`: +2 cases (`ws://host:port` and `{ ws: 'ws://host:port' }` against a live runtime).
- `test/test-web-http.js`: +2 cases (`httpBase + '/capability'` under both single-string and `{ http }` forms).
Out of scope: custom server `basePath` / `path` configurations behind a reverse proxy. Same "user URL is authoritative when non-default" model could extend to support them, but that deserves its own PR with proxy-deployment docs and tests.
Fix: #1510
0 commit comments