aboutsummaryrefslogtreecommitdiff
path: root/cli/onionshare_cli/web/website_mode.py
diff options
context:
space:
mode:
Diffstat (limited to 'cli/onionshare_cli/web/website_mode.py')
-rw-r--r--cli/onionshare_cli/web/website_mode.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/cli/onionshare_cli/web/website_mode.py b/cli/onionshare_cli/web/website_mode.py
index 1f61532b..34f5abf1 100644
--- a/cli/onionshare_cli/web/website_mode.py
+++ b/cli/onionshare_cli/web/website_mode.py
@@ -84,12 +84,13 @@ class WebsiteModeWeb(SendBaseModeWeb):
return self.stream_individual_file(self.files[index_path])
else:
- # Otherwise, render directory listing
+ # Otherwise, render directory listing, and enforce trailing slash
+ # which can help with relative asset links in sub-directories.
filenames = []
for filename in os.listdir(filesystem_path):
filenames.append(filename)
filenames.sort()
- return self.directory_listing(filenames, path, filesystem_path)
+ return self.directory_listing(filenames, path, filesystem_path, True)
# If it's a file
elif os.path.isfile(filesystem_path):
@@ -112,7 +113,7 @@ class WebsiteModeWeb(SendBaseModeWeb):
# Root directory listing
filenames = list(self.root_files)
filenames.sort()
- return self.directory_listing(filenames, path)
+ return self.directory_listing(filenames, path, None, True)
else:
# If the path isn't found, throw a 404