diff --git a/pywebfs/pywebfs.py b/pywebfs/pywebfs.py index cd1f578..2f3c1f6 100644 --- a/pywebfs/pywebfs.py +++ b/pywebfs/pywebfs.py @@ -584,6 +584,8 @@ def download(self, path): super().end_headers() with open(path, 'rb') as f: self.copyfile(f, self.wfile) + else: + self.send_error(HTTPStatus.NOT_FOUND, "File not found") def do_HEAD(self): self.send_response(HTTPStatus.OK)