diff options
-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, |