From 3620bf3a0c3066622ebf396a3bbc5801e90c094f Mon Sep 17 00:00:00 2001 From: Saptak S Date: Sat, 28 Aug 2021 15:16:50 +0530 Subject: [PATCH 1/3] Updates send.html to use file link instead of basename --- cli/onionshare_cli/resources/templates/send.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/onionshare_cli/resources/templates/send.html b/cli/onionshare_cli/resources/templates/send.html index bd9bd631..5fc1ba1f 100644 --- a/cli/onionshare_cli/resources/templates/send.html +++ b/cli/onionshare_cli/resources/templates/send.html @@ -40,7 +40,7 @@
- + {{ info.basename }}
@@ -53,7 +53,7 @@
{% if download_individual_files %} - + {{ info.basename }} {% else %} From e4880851166dc8db3818807c62862520eaec5d88 Mon Sep 17 00:00:00 2001 From: Saptak S Date: Sat, 28 Aug 2021 17:33:16 +0530 Subject: [PATCH 2/3] Updates the tests to use a full path instead of basename --- desktop/tests/test_gui_share.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/tests/test_gui_share.py b/desktop/tests/test_gui_share.py index d3536569..2cc48d17 100644 --- a/desktop/tests/test_gui_share.py +++ b/desktop/tests/test_gui_share.py @@ -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) From 6edab6877a9591a7fff7cf74607298f0d3730986 Mon Sep 17 00:00:00 2001 From: Saptak S Date: Sat, 4 Sep 2021 20:41:22 +0530 Subject: [PATCH 3/3] Removes trailing slash from directories inside directories --- cli/onionshare_cli/web/share_mode.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cli/onionshare_cli/web/share_mode.py b/cli/onionshare_cli/web/share_mode.py index 8ac4055e..92a4c9af 100644 --- a/cli/onionshare_cli/web/share_mode.py +++ b/cli/onionshare_cli/web/share_mode.py @@ -425,10 +425,7 @@ 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.append(filename) filenames.sort() return self.directory_listing(filenames, path, filesystem_path)