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

Clicking Save Torrent File button does not save .torrent file #8146

Closed
luixxiul opened this issue Apr 9, 2017 · 10 comments · Fixed by #8567
Closed

Clicking Save Torrent File button does not save .torrent file #8146

luixxiul opened this issue Apr 9, 2017 · 10 comments · Fixed by #8567

Comments

@luixxiul
Copy link
Contributor

luixxiul commented Apr 9, 2017

Test plan

#8567 (comment)

Original issue description

Describe the issue you encountered: Clicking Save Torrent File button does not save .torrent file. Instead it displays a prompt to save webtorrent.html. Also the CSP error which is same as #8145 is returned on devtool.

  • Platform (Win7, 8, 10? macOS? Linux distro?): Windows 10 32 bit

  • Brave Version (revision SHA): 0.14.2 Preview 1

  • Steps to reproduce:

    1. Visit https://webtorrent.io/free-torrents/
    2. Click "Big Buck Bunny (torrent file)"
    3. Click "Save Torrent File..."
  • Actual result: webtorrent.html is prompted

  • Expected result: the torrent file should be prompted

  • Extra QA steps:
    1.
    2.
    3.

  • Screenshot if needed:

  • Any related issues:

@bsclifton
Copy link
Member

@luixxiul luixxiul added this to the 0.14.2 milestone Apr 10, 2017
@luixxiul
Copy link
Contributor Author

On Preview 2 still the same error happens.

@bsclifton bsclifton self-assigned this Apr 11, 2017
@NejcZdovc NejcZdovc assigned NejcZdovc and unassigned bsclifton Apr 12, 2017
NejcZdovc added a commit to NejcZdovc/browser-laptop that referenced this issue Apr 12, 2017
Resolves brave#8146

Auditors: @bsclifton

Test Plan:
- Visit https://webtorrent.io/free-torrents/
- Click "Big Buck Bunny (torrent file)"
- Click "Save Torrent File..."
- File is saved
bsclifton pushed a commit that referenced this issue Apr 12, 2017
Resolves #8146

Auditors: @bsclifton

Test Plan:
- Visit https://webtorrent.io/free-torrents/
- Click "Big Buck Bunny (torrent file)"
- Click "Save Torrent File..."
- File is saved
@luixxiul
Copy link
Contributor Author

The fix does not work on Windows 10 32 bit

@cezaraugusto
Copy link
Contributor

doesn't work on Ubuntu. It saves the page instead as described on STR. Reopening

@cezaraugusto cezaraugusto reopened this Apr 22, 2017
@cezaraugusto
Copy link
Contributor

Tested on v0.15.0-RC3

@alexwykoff
Copy link
Contributor

Confirmed not working for OS X 0.15.0 RC3 cc @feross

@NejcZdovc
Copy link
Contributor

@alexwykoff I was fixing this error, so I can see that some merge conflicts were added, that's why it's not working. Let me do a followup

NejcZdovc added a commit to NejcZdovc/browser-laptop that referenced this issue Apr 23, 2017
Resolves brave#8146

Auditors: @bsclifton @bbondy

Test Plan:
- Visit https://webtorrent.io/free-torrents/
- Click "Big Buck Bunny (torrent file)"
- Click "Save Torrent File..."
- File is saved
@srirambv
Copy link
Collaborator

Works fine on 0.15.0 RC4

@alexwykoff alexwykoff changed the title Clicking Save Torrent File button does not save .torrent file Fixed save .torrent file action Apr 25, 2017
@feross
Copy link
Contributor

feross commented Apr 29, 2017

This generally looks good to me, but it would be better to actually add the querystring 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

Will send a PR to fix this.

feross added a commit that referenced this issue Apr 29, 2017
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.
@feross
Copy link
Contributor

feross commented Apr 29, 2017

PR sent: #8567

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.