Skip to content
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 parsed torrent #1770

Closed
wants to merge 3 commits into from
Closed

Fix parsed torrent #1770

wants to merge 3 commits into from

Conversation

@alxhotel
Copy link
Member

alxhotel commented Oct 28, 2019

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 parsedTorrent has an infoHash. 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?

@KayleePop

This comment has been minimized.

Copy link
Contributor

KayleePop commented Oct 30, 2019

Should parse-torrent throw if given a non-bittorrent magnet?

@alxhotel

This comment has been minimized.

Copy link
Member Author

alxhotel commented Oct 30, 2019

Good point.

The check that this PR adds is also in the code of parse-torrent here:

https://github.com/webtorrent/parse-torrent/blob/8add26b94698ede08564b16881ea24b4dede4053/index.js#L61

So I guess there is a reason why the function parseTorrent does (should?) not throw an error.

@KayleePop KayleePop mentioned this pull request Nov 3, 2019
@alxhotel

This comment has been minimized.

Copy link
Member Author

alxhotel commented Nov 4, 2019

Closing this PR in favor of webtorrent/parse-torrent#80

@alxhotel alxhotel closed this Nov 4, 2019
@alxhotel alxhotel deleted the fix-parsed-torrent branch Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.