Skip to content

Reject path components that contain a slash - #155

Closed
TastyHeadphones wants to merge 1 commit into
vapor:mainfrom
TastyHeadphones:fix/reject-slash-in-path-component
Closed

TastyHeadphones wants to merge 1 commit into
vapor:mainfrom
TastyHeadphones:fix/reject-slash-in-path-component

Conversation

@TastyHeadphones

Copy link
Copy Markdown

Path components with a / in them (e.g. app.get("te/st")) used to register as one segment that nothing could match.

That shows up as a silent 404 — see vapor/vapor#3349. Maintainer guidance there was that those components shouldn't be accepted.

This fails at init with a clear message so you use app.get("te", "st") instead. String.pathComponents is unchanged (it splits on / first).

Fixes vapor/vapor#3349

A component like "te/st" used to register as a single unreachable segment.
Fail fast instead so callers use separate components.
@0xTim

0xTim commented Sep 21, 2026

Copy link
Copy Markdown
Member

After some discussions with the community I think we should allow the / and parse it and routing build time so it all works

@0xTim

0xTim commented Sep 21, 2026

Copy link
Copy Markdown
Member

Will close this since and if you're up for it, open a new PR that solves it, thanks!

@0xTim 0xTim closed this Sep 21, 2026
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.

PathComponents with slashes are accepted, but are not reachable

2 participants