aboutsummaryrefslogtreecommitdiff
path: root/cli/onionshare_cli/web/send_base_mode.py
diff options
context:
space:
mode:
authorMiguel Jacq <mig@mig5.net>2021-05-10 11:23:44 +1000
committerMiguel Jacq <mig@mig5.net>2021-05-10 11:23:44 +1000
commit2618e89eda600184fb6f640d00528d7fc642bf60 (patch)
tree12d098596f96b2e021bd353a3f7868f82554c0da /cli/onionshare_cli/web/send_base_mode.py
parente067fc2963fb86afb4e51d816dea13f701cff70d (diff)
downloadonionshare-2618e89eda600184fb6f640d00528d7fc642bf60.tar.gz
onionshare-2618e89eda600184fb6f640d00528d7fc642bf60.zip
Register the 405 error handler properly. Enforce the appropriate methods for each route (GET or POST only, with OPTIONS disabled). Add tests for invalid methods. Add a friendlier 500 internal server error handler
Diffstat (limited to 'cli/onionshare_cli/web/send_base_mode.py')
-rw-r--r--cli/onionshare_cli/web/send_base_mode.py4
1 files changed, 0 insertions, 4 deletions
diff --git a/cli/onionshare_cli/web/send_base_mode.py b/cli/onionshare_cli/web/send_base_mode.py
index 742f6f75..2f3e0bbd 100644
--- a/cli/onionshare_cli/web/send_base_mode.py
+++ b/cli/onionshare_cli/web/send_base_mode.py
@@ -208,10 +208,6 @@ class SendBaseModeWeb:
history_id = self.cur_history_id
self.cur_history_id += 1
- # Only GET requests are allowed, any other method should fail
- if request.method != "GET":
- return self.web.error405(history_id)
-
self.web.add_request(
self.web.REQUEST_INDIVIDUAL_FILE_STARTED,
path,