fix(isMagnetURI): update validation regex#1730
Merged
profnandaa merged 3 commits intovalidatorjs:masterfrom Sep 21, 2021
Merged
fix(isMagnetURI): update validation regex#1730profnandaa merged 3 commits intovalidatorjs:masterfrom
profnandaa merged 3 commits intovalidatorjs:masterfrom
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.
|
ezkemboi
previously approved these changes
Sep 20, 2021
profnandaa
reviewed
Sep 20, 2021
profnandaa
approved these changes
Sep 21, 2021
Member
Member
|
Thanks, @profnandaa. |
Member
Author
|
Thank you @profnandaa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the
isMagnetURIvalidator regex:xtare requiredxturn using the standardxt.1andxt.2,... (URI is valid even if onlyxt.1is passed)All the changes are based on the Magnet URI scheme definition here , there is no IETF RFC concerning magnet URI.
Checklist