Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
fix(isMagnetURI): update validation regex (#1730)
* fix(isMagnetURI): update validation regex - 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 * fix(isMagnetURI): prevent matching hashes longer than 40 characters * fix(isMagnetURI): check only string ending after hash or new parameter start
- Loading branch information
Showing
2 changed files
with
20 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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