greasyfork-org / greasyfork

An online repository of user scripts.
https://greasyfork.org
GNU General Public License v3.0
1.43k stars 431 forks source link

Regex fails for jsDelivr GitHub commit-specific references #1127

Closed adamlui closed 1 year ago

adamlui commented 1 year ago

On the allows CDNs page, the regex is:

 ^(https?:)?\/\/(cdn|test1|testingcf|fastly|gcore)\.jsdelivr\.net\/gh\/[^/]+\/[^/@]+@[a-f0-9]{40}

However the commit-specific reference for jquery for example is:

https://cdn.jsdelivr.net/gh/jquery/jquery@32b00373b3f42e5cdcb709df53f3b08b7184a944/dist/jquery.min.js

Because the displayed regex only validates up to the end of the 40-length commit hash it fails validation

JasonBarnabe commented 1 year ago

The URLs on https://greasyfork.org/en/help/cdns are "contains" matches. This URL is already allowed.