mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-20 12:34:23 -04:00
Update send_base_mode.py
This commit is contained in:
parent
986a9a09a9
commit
c19dc4fa78
1 changed files with 1 additions and 3 deletions
|
@ -145,10 +145,9 @@ class SendBaseModeWeb:
|
||||||
|
|
||||||
# If filesystem_path is None, this is the root directory listing
|
# If filesystem_path is None, this is the root directory listing
|
||||||
files, dirs = self.build_directory_listing(path, filenames, filesystem_path)
|
files, dirs = self.build_directory_listing(path, filenames, filesystem_path)
|
||||||
r = self.directory_listing_template(
|
return self.directory_listing_template(
|
||||||
path, files, dirs, breadcrumbs, breadcrumbs_leaf
|
path, files, dirs, breadcrumbs, breadcrumbs_leaf
|
||||||
)
|
)
|
||||||
return self.web.add_security_headers(r)
|
|
||||||
|
|
||||||
def build_directory_listing(self, path, filenames, filesystem_path):
|
def build_directory_listing(self, path, filenames, filesystem_path):
|
||||||
files = []
|
files = []
|
||||||
|
@ -286,7 +285,6 @@ class SendBaseModeWeb:
|
||||||
"filename*": "UTF-8''%s" % url_quote(basename),
|
"filename*": "UTF-8''%s" % url_quote(basename),
|
||||||
}
|
}
|
||||||
r.headers.set("Content-Disposition", "inline", **filename_dict)
|
r.headers.set("Content-Disposition", "inline", **filename_dict)
|
||||||
r = self.web.add_security_headers(r)
|
|
||||||
(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:
|
||||||
r.headers.set("Content-Type", content_type)
|
r.headers.set("Content-Type", content_type)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue