-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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(isMagnetURI): update validation regex #1730
Conversation
- Validate only exact xn topics (btih,sha1,...) - Validate only 32 or 40 hashes - Make tr and dn parameters optional - Allow any other parameter (protocol allow passing non standard parameters) - Use placeholder hashes in tests - Fix ReDOS in old regex - Add new tests
Codecov Report
@@ Coverage Diff @@
## master #1730 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 101 101
Lines 2005 2005
Branches 452 452
=========================================
Hits 2005 2005
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the fix.
Thanks, @profnandaa. |
Thank you @profnandaa |
This PR updates the
isMagnetURI
validator regex:xt
are requiredxt
urn using the standardxt.1
andxt.2
,... (URI is valid even if onlyxt.1
is passed)All the changes are based on the Magnet URI scheme definition here , there is no IETF RFC concerning magnet URI.
Checklist