From 066b0239ee85eeafb7a8930c9e20a735c9ac0225 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Thu, 22 May 2014 19:49:42 -0400 Subject: [PATCH] added awesome pink skull and crossbone 404 error page --- 404.html | 15 +++++++++++++++ onionshare.py | 4 ++++ 2 files changed, 19 insertions(+) create mode 100644 404.html diff --git a/404.html b/404.html new file mode 100644 index 00000000..05b8eb35 --- /dev/null +++ b/404.html @@ -0,0 +1,15 @@ + + + + Error 404 + + + ☠ + diff --git a/onionshare.py b/onionshare.py index 5f7d2c70..d9095c99 100755 --- a/onionshare.py +++ b/onionshare.py @@ -31,6 +31,10 @@ def download(): basename = os.path.basename(filename) return send_from_directory(dirname, basename, as_attachment=True) +@app.errorhandler(404) +def page_not_found(e): + return render_template_string(open('{0}/404.html'.format(os.path.dirname(__file__))).read()) + def get_platform(): if 'ONIONSHARE_PLATFORM' in os.environ: return os.environ['ONIONSHARE_PLATFORM']