[autoserve] Return 404 when appropriate.

This commit is contained in:
Sergio Martínez Portela 2023-09-27 23:35:20 +02:00
parent 6d78ad53c6
commit 302ec0b764

View File

@ -70,6 +70,11 @@ class Server(http.server.SimpleHTTPRequestHandler):
self.end_headers()
return
if not os.path.exists(path.strip('/')):
self.send_response(404)
self.end_headers()
return
# send 200 response
self.send_response(200)
# send response headers