From 676aa1c5c8127b97ab65c240521fc99236b46efe Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 05 2016 21:38:14 +0000 Subject: Let's return a 404 error is the identifier provided isn't found The identifier can be one of a commit (default/expected) but also one of a blob, but in either case a 404 error seems to make more sense than a 400 one. --- diff --git a/pagure/ui/repo.py b/pagure/ui/repo.py index 71b946a..64819f3 100644 --- a/pagure/ui/repo.py +++ b/pagure/ui/repo.py @@ -622,7 +622,7 @@ def view_raw_file( commit = repo_obj[repo_obj.head.target] if not commit: - flask.abort(400, 'Commit %s not found' % (identifier)) + flask.abort(404, 'Commit %s not found' % (identifier)) if isinstance(commit, pygit2.Tag): commit = commit.get_object()