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 wildcard pattern matching for paths with multiple levels #494

Closed
wants to merge 2 commits into from
Closed

fix wildcard pattern matching for paths with multiple levels #494

wants to merge 2 commits into from

Conversation

cgaisl
Copy link
Contributor

@cgaisl cgaisl commented Mar 20, 2022

The commit 84d582e introduced a bug where the wildcard operator ('*') would only match paths one level deep. For example '/home/*' would match '/home/single', but not 'home/multiple/levels'.

@slovnicki
Copy link
Owner

Thanks for the PR @cgaisl 💙
and sorry for a late response.

I will review this over the weekend and try to see how and why it breaks the current tests.
Some negative matches in your test seem to me like the culprit, but I'll write the details when I get to my computer.

checkMatch('/home/*', '/home', false);
checkMatch('/home*', '/home/one', false);
checkMatch('*', '', false);
checkMatch('*', '/', false);
Copy link
Owner

@slovnicki slovnicki Mar 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should match, but I get into problems with other tests if I make them match.
I'll get back to it tomorrow and probably push some additional stuff into this PR.

You're right about the fix you provided, I just need to revisit how it affects other (maybe bad) tests.

@slovnicki
Copy link
Owner

Ok, I did some additional work and now it should be ready to merge. It's here now, I copied your title and secription: #502

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.

None yet

2 participants