From 64bf0408604a34d8861037a30728a682b0c2f6cb Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 29 2015 07:33:17 +0000 Subject: Be cautious and abort early if there is no data to return --- diff --git a/pagure/ui/issues.py b/pagure/ui/issues.py index 504cdfa..1b0c137 100644 --- a/pagure/ui/issues.py +++ b/pagure/ui/issues.py @@ -682,6 +682,9 @@ def view_issue_raw_file(repo, filename=None, username=None): mimetype, encoding = mimetypes.guess_type(filename) data = repo_obj[content.oid].data + if not data: + flask.abort(404, 'No content found') + if not mimetype and data[:2] == '#!': mimetype = 'text/plain'