diff options
author | Peter Wu <peter@lekensteyn.nl> | 2022-12-28 18:00:40 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2022-12-28 18:00:40 +0100 |
commit | c749e8fd12ff00800ca0ddc2b22544dbec601ab3 (patch) | |
tree | d67bbc722ed7042b8088932bbb3bd1e4d4696041 | |
parent | b703e972dc4c686a3f7780c6f6b4050f23d7417c (diff) | |
download | scripts-master.tar.gz |
-rwxr-xr-x | arch-proxy.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch-proxy.py b/arch-proxy.py index 5a7b2c2..a456c77 100755 --- a/arch-proxy.py +++ b/arch-proxy.py @@ -167,6 +167,9 @@ class RequestHandler(http.server.BaseHTTPRequestHandler): try: # Try to open cached file and yield data from it stat_info = os.stat(path) + if stat_info.st_size == 0: + # Treat empty files as missing. + raise FileNotFoundError response_headers = {'Last-Modified': epoch_to_text(stat_info.st_mtime)} self.send_ok(stat_info.st_size, response_headers, |