mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Fix bug with rendering index.html files in subdirs
This commit is contained in:
parent
bb0908d6a3
commit
ecd65f37e3
@ -30,11 +30,13 @@ class WebsiteModeWeb(SendBaseModeWeb):
|
|||||||
"""
|
"""
|
||||||
return self.render_logic(path)
|
return self.render_logic(path)
|
||||||
|
|
||||||
def directory_listing_template(self, path, files, dirs):
|
def directory_listing_template(self, path, files, dirs, breadcrumbs, breadcrumbs_leaf):
|
||||||
return make_response(render_template('listing.html',
|
return make_response(render_template('listing.html',
|
||||||
path=path,
|
path=path,
|
||||||
files=files,
|
files=files,
|
||||||
dirs=dirs,
|
dirs=dirs,
|
||||||
|
breadcrumbs=breadcrumbs,
|
||||||
|
breadcrumbs_leaf=breadcrumbs_leaf,
|
||||||
static_url_path=self.web.static_url_path))
|
static_url_path=self.web.static_url_path))
|
||||||
|
|
||||||
def set_file_info_custom(self, filenames, processed_size_callback):
|
def set_file_info_custom(self, filenames, processed_size_callback):
|
||||||
@ -51,7 +53,7 @@ class WebsiteModeWeb(SendBaseModeWeb):
|
|||||||
index_path = os.path.join(path, 'index.html')
|
index_path = os.path.join(path, 'index.html')
|
||||||
if index_path in self.files:
|
if index_path in self.files:
|
||||||
# Render it
|
# Render it
|
||||||
return self.stream_individual_file(filesystem_path)
|
return self.stream_individual_file(self.files[index_path])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Otherwise, render directory listing
|
# Otherwise, render directory listing
|
||||||
|
Loading…
Reference in New Issue
Block a user