diff options
author | Micah Lee <micah@micahflee.com> | 2019-09-08 09:35:44 -0700 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2019-09-08 09:35:44 -0700 |
commit | 3f7c4a4e2503c26dabc37f656c9875b64c63a0a6 (patch) | |
tree | 3703319bfe1b9b37dfc6d7ec3950bdb99a73505d /onionshare | |
parent | c2011e6915330910631e11695105cf83b88eb2cb (diff) | |
download | onionshare-3f7c4a4e2503c26dabc37f656c9875b64c63a0a6.tar.gz onionshare-3f7c4a4e2503c26dabc37f656c9875b64c63a0a6.zip |
Remove method from IndividualFileHistoryItem, and only display these widgets on 200 and 404 requests, not all of the others
Diffstat (limited to 'onionshare')
-rw-r--r-- | onionshare/common.py | 3 | ||||
-rw-r--r-- | onionshare/web/send_base_mode.py | 3 | ||||
-rw-r--r-- | onionshare/web/web.py | 24 |
3 files changed, 1 insertions, 29 deletions
diff --git a/onionshare/common.py b/onionshare/common.py index 06563461..ab503fdc 100644 --- a/onionshare/common.py +++ b/onionshare/common.py @@ -315,9 +315,6 @@ class Common(object): color: #666666; }""", - 'history_individual_file_request_label': """ - QLabel { }""", - 'history_individual_file_status_code_label_2xx': """ QLabel { color: #008800; diff --git a/onionshare/web/send_base_mode.py b/onionshare/web/send_base_mode.py index 3a01cb8f..6a0390ab 100644 --- a/onionshare/web/send_base_mode.py +++ b/onionshare/web/send_base_mode.py @@ -147,8 +147,7 @@ class SendBaseModeWeb: self.cur_history_id += 1 self.web.add_request(self.web.REQUEST_INDIVIDUAL_FILE_STARTED, path, { 'id': history_id, - 'filesize': filesize, - 'method': request.method + 'filesize': filesize }) # Only GET requests are allowed, any other method should fail diff --git a/onionshare/web/web.py b/onionshare/web/web.py index c4d5385f..610c14c2 100644 --- a/onionshare/web/web.py +++ b/onionshare/web/web.py @@ -196,26 +196,10 @@ class Web: self.force_shutdown() print("Someone has made too many wrong attempts to guess your password, so OnionShare has stopped the server. Start sharing again and send the recipient a new address to share.") - history_id = self.cur_history_id - self.cur_history_id += 1 - self.add_request(self.REQUEST_INDIVIDUAL_FILE_STARTED, '{}'.format(request.path), { - 'id': history_id, - 'method': request.method, - 'status_code': 401 - }) - r = make_response(render_template('401.html', static_url_path=self.static_url_path), 401) return self.add_security_headers(r) def error403(self): - history_id = self.cur_history_id - self.cur_history_id += 1 - self.add_request(self.REQUEST_INDIVIDUAL_FILE_STARTED, '{}'.format(request.path), { - 'id': history_id, - 'method': request.method, - 'status_code': 403 - }) - self.add_request(Web.REQUEST_OTHER, request.path) r = make_response(render_template('403.html', static_url_path=self.static_url_path), 403) return self.add_security_headers(r) @@ -234,14 +218,6 @@ class Web: return self.add_security_headers(r) def error405(self): - history_id = self.cur_history_id - self.cur_history_id += 1 - self.add_request(self.REQUEST_INDIVIDUAL_FILE_STARTED, '{}'.format(request.path), { - 'id': history_id, - 'method': request.method, - 'status_code': 405 - }) - r = make_response(render_template('405.html', static_url_path=self.static_url_path), 405) return self.add_security_headers(r) |