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

Wildcards can occur for any segment, not just the start, and multiply #134

Closed
quasicomputational opened this issue Apr 25, 2019 · 3 comments

Comments

@quasicomputational
Copy link

The PSL's spec says:

Wildcards are not restricted to appear only in the leftmost position, but they must wildcard an entire label. (I.e. ..foo is a valid rule: *bar.foo is not.)

...but the parsing code only looks for a single wildcard in the leftmost position:

} else if (line.startsWith('*.')) {

There aren't actually any present rules that have a non-leftmost wildcard, so this is a future-proofing concern.

@remusao
Copy link
Owner

remusao commented Apr 25, 2019

Hi @quasicomputational

We used to support wildcards in any position but following up on this discussion on the official project: publicsuffix/list#145 (comment) it appears that the current agreement is to only support wildcards at the last position (and official documentation is yet to be updated with this change). Ultimately, this also allows for more efficient matching. It would be pretty easy to support it again though, but it does not seem like it's happening for now.

Best,
Rémi

@quasicomputational
Copy link
Author

Oh, I see. I wish I'd noticed that issue before I wrote any code that has to deal with wildcards in the suffix, rather than after!

@remusao
Copy link
Owner

remusao commented Apr 25, 2019

No worries, happy I could help. Could you maybe edit the description of your other issue publicsuffix/list#806 to reflect the status of this one?

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

No branches or pull requests

2 participants