From dc4eaffa97af88abd6862100ffa8f3c5a6cd1f90 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Tue, 11 May 2021 08:14:49 +1000 Subject: [PATCH] Website mode doesn't need to support POST as a method --- cli/onionshare_cli/web/website_mode.py | 4 ++-- desktop/tests/test_gui_website.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/onionshare_cli/web/website_mode.py b/cli/onionshare_cli/web/website_mode.py index 29b2cc9b..5ab1b184 100644 --- a/cli/onionshare_cli/web/website_mode.py +++ b/cli/onionshare_cli/web/website_mode.py @@ -37,8 +37,8 @@ class WebsiteModeWeb(SendBaseModeWeb): The web app routes for sharing a website """ - @self.web.app.route("/", defaults={"path": ""}, methods=["GET", "POST"], provide_automatic_options=False) - @self.web.app.route("/", methods=["GET", "POST"], provide_automatic_options=False) + @self.web.app.route("/", defaults={"path": ""}, methods=["GET"], provide_automatic_options=False) + @self.web.app.route("/", methods=["GET"], provide_automatic_options=False) def path_public(path): return path_logic(path) diff --git a/desktop/tests/test_gui_website.py b/desktop/tests/test_gui_website.py index 6bb6bb7a..f526756a 100644 --- a/desktop/tests/test_gui_website.py +++ b/desktop/tests/test_gui_website.py @@ -112,6 +112,6 @@ class TestWebsite(GuiBaseTest): self.run_all_website_mode_setup_tests(tab) self.run_all_website_mode_started_tests(tab) url = f"http://127.0.0.1:{tab.app.port}/" - self.hit_405(url, expected_resp="OnionShare: 405 Method Not Allowed", data = {'foo':'bar'}, methods = ["put", "delete", "options"]) + self.hit_405(url, expected_resp="OnionShare: 405 Method Not Allowed", data = {'foo':'bar'}, methods = ["put", "post", "delete", "options"]) self.close_all_tabs()