[autoserve] Return 404 when appropriate.
This commit is contained in:
parent
6d78ad53c6
commit
302ec0b764
@ -70,6 +70,11 @@ class Server(http.server.SimpleHTTPRequestHandler):
|
|||||||
self.end_headers()
|
self.end_headers()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if not os.path.exists(path.strip('/')):
|
||||||
|
self.send_response(404)
|
||||||
|
self.end_headers()
|
||||||
|
return
|
||||||
|
|
||||||
# send 200 response
|
# send 200 response
|
||||||
self.send_response(200)
|
self.send_response(200)
|
||||||
# send response headers
|
# send response headers
|
||||||
|
Loading…
Reference in New Issue
Block a user