Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Fix "Save Torrent File" feature #8567

Merged
merged 1 commit into from
May 2, 2017
Merged

Conversation

feross
Copy link
Contributor

@feross feross commented Apr 29, 2017

Fixes #8146

This feature broke again after PR #8325. My fault for not catching it
during review. This PR fixes the code that is now on master.

Addresses these comments:

It is better to add the '?download=true' querystring param with
url.parse and url.format since blindly tacking on a
'?download=true' can lead to invalid URLs.

A couple examples:

  • magnet:?a=b&c=d?download=true is invalid and should use &download=true instead
  • https://example.com/file.torrent#ix=1?download=true is invalid as there should not be a query param after a hash

Also, this names the downloaded file correctly, which didn't seem to be working either after PR #8325.

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Didn't submit an issue since this isn't broken in a released version of Brave, just on master as of a few minutes ago. Lmk if I still should make an issue.

Test Plan:

This feature broke again after PR #8325. My fault for not catching it
during review. This PR fixes the code that is now on `master`.

Addresses these comments:

-
#8446 (comment)
-
#8146 (comment)
52

It is better to add the '?download=true' querystring param with
`url.parse` and `url.format` since blindly tacking on a
'?download=true' can lead to invalid URLs.

A couple examples:

magnet:?a=b&c=d?download=true should use &download=true instead
https://example.com/file.torrent#ix=1?download=true should not add a
query param after a hash

Also, this names the downloaded file correctly, which didn't seem to be
working either after PR #8325.
Copy link
Member

@diracdeltas diracdeltas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works for me, thanks for checking this

@diracdeltas diracdeltas merged commit ff5d751 into master May 2, 2017
@diracdeltas diracdeltas deleted the fix/save-torrent-file branch May 2, 2017 00:19
@brave brave deleted a comment from vskrch Jun 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clicking Save Torrent File button does not save .torrent file
3 participants