Add an error 401 handler, and make it start counting invalid password guesses instead of 404 errors for rate limiting

This commit is contained in:
Micah Lee 2019-05-20 19:04:50 -07:00
parent 2a50bbc3bc
commit 79b87c3e30
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
7 changed files with 56 additions and 28 deletions

View file

@ -472,7 +472,10 @@ class OnionShareGui(QtWidgets.QMainWindow):
if event["type"] == Web.REQUEST_OTHER:
if event["path"] != '/favicon.ico' and event["path"] != "/{}/shutdown".format(mode.web.shutdown_slug):
self.status_bar.showMessage('[#{0:d}] {1:s}: {2:s}'.format(mode.web.error404_count, strings._('other_page_loaded'), event["path"]))
self.status_bar.showMessage('{0:s}: {1:s}'.format(strings._('other_page_loaded'), event["path"]))
if event["type"] == Web.REQUEST_INVALID_SLUG:
self.status_bar.showMessage('[#{0:d}] {1:s}: {2:s}'.format(mode.web.invalid_slugs_count, strings._('invalid_slug_guess'), event["data"]))
mode.timer_callback()