mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Merge pull request #1406 from SaptakS/fix-filelisting
Fixes directory listing in send mode
This commit is contained in:
commit
bb1b3ad157
@ -40,7 +40,7 @@
|
||||
<div class="d-flex">
|
||||
<div>
|
||||
<img width="30" height="30" title="" alt="" src="{{ static_url_path }}/img/web_folder.png" />
|
||||
<a href="{{ info.basename }}">
|
||||
<a href="{{ info.link }}">
|
||||
<span>{{ info.basename }}</span>
|
||||
</a>
|
||||
</div>
|
||||
@ -53,7 +53,7 @@
|
||||
<div>
|
||||
<img width="30" height="30" title="" alt="" src="{{ static_url_path }}/img/web_file.png" />
|
||||
{% if download_individual_files %}
|
||||
<a href="{{ info.basename }}">
|
||||
<a href="{{ info.link }}">
|
||||
<span>{{ info.basename }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
|
@ -425,9 +425,6 @@ class ShareModeWeb(SendBaseModeWeb):
|
||||
# Render directory listing
|
||||
filenames = []
|
||||
for filename in os.listdir(filesystem_path):
|
||||
if os.path.isdir(os.path.join(filesystem_path, filename)):
|
||||
filenames.append(filename + "/")
|
||||
else:
|
||||
filenames.append(filename)
|
||||
filenames.sort()
|
||||
return self.directory_listing(filenames, path, filesystem_path)
|
||||
|
@ -99,7 +99,7 @@ class TestShare(GuiBaseTest):
|
||||
self.assertEqual(r.status_code, 404)
|
||||
self.download_share(tab)
|
||||
else:
|
||||
self.assertTrue('a href="test.txt"' in r.text)
|
||||
self.assertTrue('a href="/test.txt"' in r.text)
|
||||
r = requests.get(download_file_url)
|
||||
|
||||
tmp_file = tempfile.NamedTemporaryFile("wb", delete=False)
|
||||
|
Loading…
Reference in New Issue
Block a user