Commit 1cb25944 authored by echel0n's avatar echel0n
Browse files

Do not log 401 and 404 HTTP errors, to much bot scanning activity

parent 2a3dbf37
......@@ -51,7 +51,7 @@ class BaseHandler(RequestHandler):
return locale.get(
def write_error(self, status_code, **kwargs):
if "exc_info" in kwargs:
if status_code not in [401, 404] and "exc_info" in kwargs:
exc_info = kwargs["exc_info"]
error = repr(exc_info[1])
......@@ -28,15 +28,11 @@ from sickrage.core.webserver.handlers.base import BaseHandler
class NotFoundHandler(BaseHandler):
def prepare(self):
url = self.request.uri
if not self.request.uri.startswith(
return self.redirect(url)
url = url[len( + 1:]
return self.redirect(self.request.uri)
if url[:3] != 'api':
if self.request.uri[len( + 1:][:3] != 'api':
raise tornado.web.HTTPError(
reason="You have reached this page by accident, please check the url."
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment