mirror of
https://github.com/onionshare/onionshare.git
synced 2025-07-28 00:55:40 -04:00
Merge pull request #1406 from SaptakS/fix-filelisting
Fixes directory listing in send mode
This commit is contained in:
commit
bb1b3ad157
3 changed files with 4 additions and 7 deletions
|
@ -40,7 +40,7 @@
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<div>
|
<div>
|
||||||
<img width="30" height="30" title="" alt="" src="{{ static_url_path }}/img/web_folder.png" />
|
<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>
|
<span>{{ info.basename }}</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
<div>
|
<div>
|
||||||
<img width="30" height="30" title="" alt="" src="{{ static_url_path }}/img/web_file.png" />
|
<img width="30" height="30" title="" alt="" src="{{ static_url_path }}/img/web_file.png" />
|
||||||
{% if download_individual_files %}
|
{% if download_individual_files %}
|
||||||
<a href="{{ info.basename }}">
|
<a href="{{ info.link }}">
|
||||||
<span>{{ info.basename }}</span>
|
<span>{{ info.basename }}</span>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
|
@ -425,9 +425,6 @@ class ShareModeWeb(SendBaseModeWeb):
|
||||||
# Render directory listing
|
# Render directory listing
|
||||||
filenames = []
|
filenames = []
|
||||||
for filename in os.listdir(filesystem_path):
|
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.append(filename)
|
||||||
filenames.sort()
|
filenames.sort()
|
||||||
return self.directory_listing(filenames, path, filesystem_path)
|
return self.directory_listing(filenames, path, filesystem_path)
|
||||||
|
|
|
@ -99,7 +99,7 @@ class TestShare(GuiBaseTest):
|
||||||
self.assertEqual(r.status_code, 404)
|
self.assertEqual(r.status_code, 404)
|
||||||
self.download_share(tab)
|
self.download_share(tab)
|
||||||
else:
|
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)
|
r = requests.get(download_file_url)
|
||||||
|
|
||||||
tmp_file = tempfile.NamedTemporaryFile("wb", delete=False)
|
tmp_file = tempfile.NamedTemporaryFile("wb", delete=False)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue