Skip to content

test: cover ignoreTrailingSlash for websocket upgrades, update README - #498

Merged
Tony133 merged 3 commits into
mainfrom
docs/ws-ignore-trailing-slash
Nov 18, 2026
Merged

Tony133 merged 3 commits into
mainfrom
docs/ws-ignore-trailing-slash

Conversation

@Tony133

@Tony133 Tony133 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Proposal:

  • Add a WebSocket test for ignoreTrailingSlash and remove the outdated entries from the README.
  • The README lists "support ignoreTrailingSlash" among the missing WebSocket features, but upgrades are dispatched through the regular Fastify router and the same handler as HTTP requests, so the option already applies to them. There was no WebSocket test covering it, though.

Changes:

  • adds test/ws-ignore-trailing-slash.js, which checks that with ignoreTrailingSlash: true upgrades are proxied to the expected upstream path for prefixes with and without a trailing slash, with rewritePrefix, and next to another upgrade listener. It also checks the opposite case:
    • without the option, a /api/ prefix refuses /api with a 404.
  • removes ignoreTrailingSlash from the list of missing WebSocket features in the README. Request id logging and forwarding of multiple subprotocols are still listed.
  • removes the TODO section from the README. Its two entries date back to 2018 and 2020: the WebSocket one is covered in more detail by the websocket section, and incoming data can be validated through the preValidation option.

Note:

  • No changes to the plugin code.

@Tony133
Tony133 requested a review from a team November 18, 2026 10:35
Comment thread test/ws-ignore-trailing-slash.js Resolved
Comment thread test/ws-ignore-trailing-slash.js Resolved
Comment thread test/ws-ignore-trailing-slash.js Resolved
@Tony133
Tony133 requested review from a team and ilteoood November 18, 2026 14:04
Comment thread test/ws-ignore-trailing-slash.js Resolved
@Tony133
Tony133 requested review from a team and ilteoood November 18, 2026 19:43
@Tony133
Tony133 merged commit 5d586a0 into main Nov 18, 2026
22 checks passed
@Tony133
Tony133 deleted the docs/ws-ignore-trailing-slash branch November 18, 2026 21:34
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.

2 participants