Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] ISSUE138: S10 shouldn't match S1/:context: #149

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

stopcoder
Copy link

The regex used for OPTIONAL SLASH is too general for some cases like S1/:context:. The slash between '1' and ':' shouldn't be optional because there's no REQUIRED SLASH or QUERY after it.

In the fix, I distinguish between the OPTIONAL SLASH and the conditionally optional slash. Only when the optional slash is before a REQUIRED SLASH or around a QUERY (either optional or required) string or followed by a static slash, it's then optional. Otherwise it's called the conditionally optional. Conditional means that it's required unless it's at the beginning or end of the pattern.

I also added tests to the match spec.

Best regards,
Jiawei

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.

1 participant