Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upFix parsed torrent #1770
Closed
Fix parsed torrent #1770
+32
−1
Conversation
This comment has been minimized.
This comment has been minimized.
|
Should parse-torrent throw if given a non-bittorrent magnet? |
This comment has been minimized.
This comment has been minimized.
|
Good point. The check that this PR adds is also in the code of So I guess there is a reason why the function |
Merged
This comment has been minimized.
This comment has been minimized.
|
Closing this PR in favor of webtorrent/parse-torrent#80 |
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.
alxhotel commentedOct 28, 2019
•
edited
What is the purpose of this pull request? (put an "X" next to item)
Fixes issue webtorrent-cli#64.
[ ] Documentation update
[X] Bug fix
[ ] New feature
[ ] Other, please explain:
What changes did you make? (Give an overview)
This PR checks that the
parsedTorrenthas aninfoHash. If so, this means it is a valid Bittorrent magnet. Thus, other magnets, like the ones used by Gnutella (e.g.magnet:?xt=urn:sha1:PD...), are not valid.Also this PR adds a test to check this behaviour.
Which issue (if any) does this pull request address?
webtorrent-cli#64
Is there anything you'd like reviewers to focus on?