mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-08 01:15:00 -04:00
Update share_mode.py
This commit is contained in:
parent
c19dc4fa78
commit
04fae8ada1
1 changed files with 2 additions and 5 deletions
|
@ -149,8 +149,7 @@ class ShareModeWeb(SendBaseModeWeb):
|
||||||
and self.download_in_progress
|
and self.download_in_progress
|
||||||
)
|
)
|
||||||
if deny_download:
|
if deny_download:
|
||||||
r = make_response(render_template("denied.html"))
|
return render_template("denied.html")
|
||||||
return self.web.add_security_headers(r)
|
|
||||||
|
|
||||||
# If download is allowed to continue, serve download page
|
# If download is allowed to continue, serve download page
|
||||||
if self.should_use_gzip():
|
if self.should_use_gzip():
|
||||||
|
@ -172,8 +171,7 @@ class ShareModeWeb(SendBaseModeWeb):
|
||||||
and self.download_in_progress
|
and self.download_in_progress
|
||||||
)
|
)
|
||||||
if deny_download:
|
if deny_download:
|
||||||
r = make_response(render_template("denied.html"))
|
return render_template("denied.html")
|
||||||
return self.web.add_security_headers(r)
|
|
||||||
|
|
||||||
# Prepare some variables to use inside generate() function below
|
# Prepare some variables to use inside generate() function below
|
||||||
# which is outside of the request context
|
# which is outside of the request context
|
||||||
|
@ -232,7 +230,6 @@ class ShareModeWeb(SendBaseModeWeb):
|
||||||
"filename*": "UTF-8''%s" % url_quote(basename),
|
"filename*": "UTF-8''%s" % url_quote(basename),
|
||||||
}
|
}
|
||||||
r.headers.set("Content-Disposition", "attachment", **filename_dict)
|
r.headers.set("Content-Disposition", "attachment", **filename_dict)
|
||||||
r = self.web.add_security_headers(r)
|
|
||||||
# guess content type
|
# guess content type
|
||||||
(content_type, _) = mimetypes.guess_type(basename, strict=False)
|
(content_type, _) = mimetypes.guess_type(basename, strict=False)
|
||||||
if content_type is not None:
|
if content_type is not None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue