Webkit1 compatibility: send 404 error if the file don't exists

Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
This commit is contained in:
Gonzalo Odiard 2014-01-30 12:08:55 -03:00
parent 79b3480a13
commit 30b67cc3d1

View File

@ -46,6 +46,8 @@ class LocalRequestHandler(BaseHTTPRequestHandler):
new_path = self.server.path + '/' + self.path new_path = self.server.path + '/' + self.path
if not os.path.exists(new_path): if not os.path.exists(new_path):
logging.error('file %s not found.', new_path) logging.error('file %s not found.', new_path)
self.send_response(404)
self.end_headers()
return False return False
with open(new_path) as f: with open(new_path) as f: