mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add proper status to 404 responses.
This commit is contained in:
parent
e38934976a
commit
07b9a4a39b
@ -574,7 +574,8 @@ class DocumentationApplication(object):
|
||||
"""
|
||||
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 = {
|
||||
@ -679,7 +680,7 @@ class DocumentationApplication(object):
|
||||
try:
|
||||
if req.path == '/favicon.ico':
|
||||
# TODO: change this to real favicon?
|
||||
resp = self.get_error_404(req)
|
||||
resp = Response('404 Not Found', status=404)
|
||||
elif req.path == '/robots.txt':
|
||||
resp = Response(robots_txt, mimetype='text/plain')
|
||||
elif not req.path.endswith('/') and req.method == 'GET':
|
||||
|
Loading…
Reference in New Issue
Block a user