Skip to content

fix: handle comma-separated wildcard paths in allow rules#170

Merged
zedkipp merged 1 commit intomainfrom
zedkipp/comma-wildcard-rules
Feb 17, 2026
Merged

fix: handle comma-separated wildcard paths in allow rules#170
zedkipp merged 1 commit intomainfrom
zedkipp/comma-wildcard-rules

Conversation

@zedkipp
Copy link
Contributor

@zedkipp zedkipp commented Feb 17, 2026

This issue was found by @jatcod3r here: #91 (comment)

The path segment parser rejected * followed by , (e.g., path=/api/v1/*,/api/v2/*) because it only allowed * to be followed by / or end-of-string. Fix by checking for any valid path segment character, so * is valid as a standalone segment whenever the next character is not a valid path character.


if len(input) > 0 && input[0] == '*' {
if len(input) > 1 && input[1] != '/' {
if len(input) > 1 && isPChar(input[1]) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the only valid symbols after * is either / or ,? We can explicitly check for them? But isPChar also looks good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think whitespace would be permitted, too. I update this to be more restrictive because we really just need to check for a path segment terminator.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think whitespace would be permitted, too. - make sense

The path segment parser rejected `*` followed by `,` (e.g., `path=/api/v1/*,/api/v2/*`)
because it only allowed `*` to be followed by `/` or end-of-string. Fix by checking for
any valid path segment character, so `*` is valid as a standalone segment whenever the
next character is not a valid path character.
@zedkipp zedkipp force-pushed the zedkipp/comma-wildcard-rules branch from 13a73a6 to 119cbb7 Compare February 17, 2026 19:21
@zedkipp zedkipp merged commit d3a2bdd into main Feb 17, 2026
5 checks passed
@zedkipp zedkipp deleted the zedkipp/comma-wildcard-rules branch February 17, 2026 20:27
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

Comments