Skip to content

feat: disallow regexp constraint in optional wildcards#77

Merged
tigerwill90 merged 1 commit intomasterfrom
feat/disallow-regexp-optional-wildcard
Feb 10, 2026
Merged

feat: disallow regexp constraint in optional wildcards#77
tigerwill90 merged 1 commit intomasterfrom
feat/disallow-regexp-optional-wildcard

Conversation

@tigerwill90
Copy link
Collaborator

@tigerwill90 tigerwill90 commented Feb 10, 2026

Optional wildcards (*{param}) can match an empty string, so allowing a regexp on them creates an ambiguity: two routes with different regexps would both match the same empty-string path, with no clear priority on who is the one matching first.

This PR rejects *{param:regexp} at registration time.

Note that +{param:regexp} is unaffected since non-optional wildcards require at least one character.

@tigerwill90 tigerwill90 marked this pull request as ready for review February 10, 2026 20:52
@tigerwill90 tigerwill90 requested a review from pawndev February 10, 2026 20:52
@tigerwill90 tigerwill90 merged commit 353ee02 into master Feb 10, 2026
4 checks passed
@tigerwill90 tigerwill90 deleted the feat/disallow-regexp-optional-wildcard branch February 10, 2026 20:55
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