summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaptak Sengupta <saptak013@gmail.com>2021-02-22 00:01:19 +0530
committerGitHub <noreply@github.com>2021-02-22 00:01:19 +0530
commit3b997163920b9dba22edf58216d484fc5b6ea334 (patch)
tree49e95174cdd4f3fadf26946984eaf8f5ece30af2
parentff9c20137281b1b6a457c37a2dbdecb5e9e685ae (diff)
parentc0c4b3da167979343d9259d9c8c38f74984f5a5c (diff)
downloadonionshare-3b997163920b9dba22edf58216d484fc5b6ea334.tar.gz
onionshare-3b997163920b9dba22edf58216d484fc5b6ea334.zip
Merge pull request #1279 from micahflee/1277_download_attachment
Set content-disposition to attachment for /download
-rw-r--r--cli/onionshare_cli/web/share_mode.py6
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)