summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Jacq <mig@mig5.net>2021-05-11 08:14:49 +1000
committerMiguel Jacq <mig@mig5.net>2021-05-11 08:14:49 +1000
commitdc4eaffa97af88abd6862100ffa8f3c5a6cd1f90 (patch)
tree224b147188fe92511c0528a05425e00e21cf3280
parent97922d33d0808e73de7ed463c5efbd8c400b98c7 (diff)
downloadonionshare-dc4eaffa97af88abd6862100ffa8f3c5a6cd1f90.tar.gz
onionshare-dc4eaffa97af88abd6862100ffa8f3c5a6cd1f90.zip
Website mode doesn't need to support POST as a method
-rw-r--r--cli/onionshare_cli/web/website_mode.py4
-rw-r--r--desktop/tests/test_gui_website.py2
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("/<path:path>", methods=["GET", "POST"], provide_automatic_options=False)
+ @self.web.app.route("/", defaults={"path": ""}, methods=["GET"], provide_automatic_options=False)
+ @self.web.app.route("/<path:path>", 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()