diff options
author | Micah Lee <micah@micahflee.com> | 2021-02-21 10:22:54 -0800 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2021-02-21 10:22:54 -0800 |
commit | c0c4b3da167979343d9259d9c8c38f74984f5a5c (patch) | |
tree | e66d7b233fae8ceae354021bbc426705750a0809 /cli | |
parent | d9bd52ec34bbba967de927b4f88751bbd64b3cf3 (diff) | |
download | onionshare-c0c4b3da167979343d9259d9c8c38f74984f5a5c.tar.gz onionshare-c0c4b3da167979343d9259d9c8c38f74984f5a5c.zip |
Set content-disposition to attachment for /download, to always force a download
Diffstat (limited to 'cli')
-rw-r--r-- | cli/onionshare_cli/web/share_mode.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/onionshare_cli/web/share_mode.py b/cli/onionshare_cli/web/share_mode.py index 6d29eaff..821f4978 100644 --- a/cli/onionshare_cli/web/share_mode.py +++ b/cli/onionshare_cli/web/share_mode.py @@ -200,10 +200,10 @@ class ShareModeWeb(SendBaseModeWeb): r.headers.set("Content-Encoding", "gzip") r.headers.set("Content-Length", self.filesize) filename_dict = { - 'filename': unidecode(basename), - 'filename*': "UTF-8''%s" % url_quote(basename) + "filename": unidecode(basename), + "filename*": "UTF-8''%s" % url_quote(basename), } - r.headers.set("Content-Disposition", "inline", **filename_dict) + r.headers.set("Content-Disposition", "attachment", **filename_dict) r = self.web.add_security_headers(r) # guess content type (content_type, _) = mimetypes.guess_type(basename, strict=False) |