diff --git a/snappass/main.py b/snappass/main.py index 907d9bf..8877a1e 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -184,7 +184,7 @@ def handle_password(): def preview_password(password_key): password_key = url_unquote_plus(password_key) if not password_exists(password_key): - abort(404) + return render_template('expired.html'), 404 return render_template('preview.html') @@ -194,7 +194,7 @@ def show_password(password_key): password_key = url_unquote_plus(password_key) password = get_password(password_key) if not password: - abort(404) + return render_template('expired.html'), 404 return render_template('password.html', password=password) diff --git a/snappass/templates/expired.html b/snappass/templates/expired.html new file mode 100644 index 0000000..5d36855 --- /dev/null +++ b/snappass/templates/expired.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} + +{% block content %} +
+
+ +

The requested URL was not found on the server. This could be because this URL never contained a secret, or because it expired or revealed earlier.

+

If this URL was sent to you by someone, make sure to check your spelling or ask the person who sent it to you to send a new secret.

+
+
+{% endblock %}