Fixed http status code when requesting a non-existing static page using Tordado web server. Fixed #1161.
This commit is contained in:
parent
b4e8b90656
commit
03fd7fd142
@ -8,6 +8,10 @@ Version 1.5.1 (unreleased)
|
||||
==========================
|
||||
[https://github.com/OpenSlides/OpenSlides/issues?milestone=15]
|
||||
|
||||
Other:
|
||||
- Fixed http status code when requesting a non-existing static page using
|
||||
Tordado web server.
|
||||
|
||||
|
||||
Version 1.5 (2013-11-25)
|
||||
========================
|
||||
|
@ -43,10 +43,10 @@ class DjangoStaticFileHandler(StaticFileHandler):
|
||||
# a shared root prefix
|
||||
# - we do not handle self.default_filename (we do not use it and it
|
||||
# does not make much sense here anyway)
|
||||
if not os.path.exists(absolute_path):
|
||||
if absolute_path is None or not os.path.exists(absolute_path):
|
||||
raise HTTPError(404)
|
||||
if not os.path.isfile(absolute_path):
|
||||
raise HTTPError(403, "%s is not a file", self.path)
|
||||
raise HTTPError(403, 'The requested resource is not a file.')
|
||||
return absolute_path
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user