Add proper status to 404 responses.

This commit is contained in:
Georg Brandl 2007-08-14 20:13:04 +00:00
parent e38934976a
commit 07b9a4a39b

View File

@ -574,7 +574,8 @@ class DocumentationApplication(object):
""" """
Show a simple error 404 page. Show a simple error 404 page.
""" """
return Response(render_template(req, 'not_found.html', self.globalcontext)) return Response(render_template(req, 'not_found.html', self.globalcontext),
status=404)
pretty_type = { pretty_type = {
@ -679,7 +680,7 @@ class DocumentationApplication(object):
try: try:
if req.path == '/favicon.ico': if req.path == '/favicon.ico':
# TODO: change this to real favicon? # TODO: change this to real favicon?
resp = self.get_error_404(req) resp = Response('404 Not Found', status=404)
elif req.path == '/robots.txt': elif req.path == '/robots.txt':
resp = Response(robots_txt, mimetype='text/plain') resp = Response(robots_txt, mimetype='text/plain')
elif not req.path.endswith('/') and req.method == 'GET': elif not req.path.endswith('/') and req.method == 'GET':