[autoserve] Return 404 when appropriate.
This commit is contained in:
parent
6d78ad53c6
commit
302ec0b764
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue