Add static route to 403 error

This commit is contained in:
Dominik V. Salonen 2016-10-19 08:10:51 +02:00 committed by GitHub
parent e7b6ff453e
commit a7ca8570da
1 changed files with 2 additions and 0 deletions

2
run.py
View File

@ -164,6 +164,8 @@ def serve_legacy(filename):
def nginx_error(error): def nginx_error(error):
if error == 413: if error == 413:
return error_page(error="O-o-onii-chan, noo it's too big ~~", code=413), 413 return error_page(error="O-o-onii-chan, noo it's too big ~~", code=413), 413
elif error == 403: # Block IPs with your web server and return /error/403 for this page
return error_page(error="Sorry, the IP you're using has been blocked due to excessive abuse", code=403), 403
else: else:
return error_page(error="We literally have no idea what just happened", code="Unknown") return error_page(error="We literally have no idea what just happened", code="Unknown")