diff options
-rw-r--r-- | newspipe/web/views/icon.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/newspipe/web/views/icon.py b/newspipe/web/views/icon.py index bbb98ea5..62c39c3e 100644 --- a/newspipe/web/views/icon.py +++ b/newspipe/web/views/icon.py @@ -11,6 +11,10 @@ icon_bp = Blueprint("icon", __name__, url_prefix="/icon") @icon_bp.route("/", methods=["GET"]) @etag_match def icon(): - icon = IconController().get(url=request.args["url"]) - headers = {"Cache-Control": "max-age=86400", "Content-Type": icon.mimetype} - return Response(base64.b64decode(icon.content), headers=headers) + try: + icon = IconController().get(url=request.args["url"]) + headers = {"Cache-Control": "max-age=86400", "Content-Type": icon.mimetype} + return Response(base64.b64decode(icon.content), headers=headers) + except: + headers = {"Cache-Control": "max-age=86400", "Content-Type": "image/gif"} + return Response(base64.b64decode("R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="), headers=headers) |