Skip to content

feat(routing): make request path decoding configurable#3451

Open
ErfanMomeniii wants to merge 1 commit into
slimphp:5.xfrom
ErfanMomeniii:decode-path-optional
Open

feat(routing): make request path decoding configurable#3451
ErfanMomeniii wants to merge 1 commit into
slimphp:5.xfrom
ErfanMomeniii:decode-path-optional

Conversation

@ErfanMomeniii
Copy link
Copy Markdown
Contributor

The routing middleware decodes the request path with rawurldecode() before dispatch, which collapses %2F into / and prevents routes like /something/{magic}/{foo} from matching /something/magic/foo%2Fbar. This PR adds a decodePath parameter on App::addRoutingMiddleware(); passing false skips that decoding, so encoded reserved characters survive routing and reach handlers untouched. The default remains true, so existing applications are unaffected.

Fixes #3374

@ErfanMomeniii
Copy link
Copy Markdown
Contributor Author

Hi @odan, please review it.

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 96.794% (+0.03%) from 96.768% — ErfanMomeniii:decode-path-optional into slimphp:5.x

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