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

Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
master
Gonzalo Odiard 10 years ago
parent 79b3480a13
commit 30b67cc3d1

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

Loading…
Cancel
Save