Z User
phase7: MCP stdio smoke test (handshake + tools/list + get_roots 6:74) — 4/4 tests PASS
54a6341 Download node_modules/fast-uri/test/websocket-query-preservation.test.js from bravesigma/quran-md-plugin: direct link, hf CLI and curl.
- Browser
- Download file 903 Bytes
-
https://huggingface.co/datasets/bravesigma/quran-md-plugin/resolve/main/node_modules/fast-uri/test/websocket-query-preservation.test.js
- Command line
-
hf download hf://datasets/bravesigma/quran-md-plugin/node_modules/fast-uri/test/websocket-query-preservation.test.js
-
curl -L -o websocket-query-preservation.test.js https://huggingface.co/datasets/bravesigma/quran-md-plugin/resolve/main/node_modules/fast-uri/test/websocket-query-preservation.test.js
903 Bytes
| const test = require('tape') | |
| const fastURI = require('..') | |
| test('WebSocket queries preserve additional question marks', (t) => { | |
| for (const scheme of ['ws', 'wss']) { | |
| const uri = `${scheme}://example.com/chat?a?b` | |
| const truncatedURI = `${scheme}://example.com/chat?a` | |
| const parsed = fastURI.parse(uri) | |
| t.equal(parsed.resourceName, '/chat?a?b', `${scheme} parse preserves the resource name`) | |
| t.equal(fastURI.serialize(parsed), uri, `${scheme} parsed components round-trip`) | |
| t.equal( | |
| fastURI.serialize({ scheme, host: 'example.com', resourceName: '/chat?a?b' }), | |
| uri, | |
| `${scheme} resource name serializes without truncation` | |
| ) | |
| t.equal(fastURI.normalize(uri), uri, `${scheme} normalization preserves the full query`) | |
| t.equal(fastURI.equal(uri, truncatedURI), false, `${scheme} equality distinguishes the full query`) | |
| } | |
| t.end() | |
| }) | |