Return HttpResponseNotFound(), got 20 exceptions emails this morning :D
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
This commit is contained in:
parent
c135c35670
commit
e8670bc853
@ -234,8 +234,13 @@ def package_version_metadata(request, category, package, version_tag):
|
|||||||
revision=rev, overlay=over)
|
revision=rev, overlay=over)
|
||||||
content = ""
|
content = ""
|
||||||
if version.metadata_path:
|
if version.metadata_path:
|
||||||
|
try:
|
||||||
with open(version.metadata_path) as meta_file:
|
with open(version.metadata_path) as meta_file:
|
||||||
content = meta_file.read()
|
content = meta_file.read()
|
||||||
|
except IOError:
|
||||||
|
return HttpResponseNotFound()
|
||||||
|
else:
|
||||||
|
return HttpResponseNotFound()
|
||||||
return HttpResponse(content, content_type="text/plain")
|
return HttpResponse(content, content_type="text/plain")
|
||||||
|
|
||||||
|
|
||||||
@ -248,8 +253,13 @@ def package_version_ebuild(request, category, package, version_tag):
|
|||||||
version = get_object_or_404(Version, package=package, version=ver,
|
version = get_object_or_404(Version, package=package, version=ver,
|
||||||
revision=rev, overlay=over)
|
revision=rev, overlay=over)
|
||||||
if version.ebuild_path:
|
if version.ebuild_path:
|
||||||
|
try:
|
||||||
with open(version.ebuild_path) as ebuild_file:
|
with open(version.ebuild_path) as ebuild_file:
|
||||||
content = ebuild_file.read()
|
content = ebuild_file.read()
|
||||||
|
except IOError:
|
||||||
|
return HttpResponseNotFound()
|
||||||
|
else:
|
||||||
|
return HttpResponseNotFound()
|
||||||
return HttpResponse(content, content_type="text/plain")
|
return HttpResponse(content, content_type="text/plain")
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user