Website mode doesn't need to support POST as a method

This commit is contained in:
Miguel Jacq 2021-05-11 08:14:49 +10:00
parent 97922d33d0
commit dc4eaffa97
No known key found for this signature in database
GPG Key ID: EEA4341C6D97A0B6
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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()