diff --git a/paste/home.py b/paste/home.py index 48670d2..b7a4fb4 100755 --- a/paste/home.py +++ b/paste/home.py @@ -5,7 +5,7 @@ from flask import ( redirect, render_template, request, - url_for, + url_for, abort, ) from werkzeug import Response @@ -60,5 +60,9 @@ def get_content(path: str) -> str: :return: Paste content. """ db = connect_redis() - flash(db.get(path)) - return render_template("content.html.j2") + data = db.get(path) + if check_content_exist(path): + flash(data) + return render_template("content.html.j2") + else: + abort(404)