diff options
Diffstat (limited to 'arch-proxy.py')
-rwxr-xr-x | arch-proxy.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch-proxy.py b/arch-proxy.py index a8f5fd0..1ce6fa8 100755 --- a/arch-proxy.py +++ b/arch-proxy.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # Arch Linux packages proxy # -# Proxies requests, caching files with ".pkg.tar.xz" suffix. +# Proxies requests, caching files with ".pkg.tar.*" suffix. # If the cached file exists, serve that file. # Otherwise, try to download file (as normally) and optionally cache it with # ".download" extension. If the file exists and the file is not being @@ -241,7 +241,9 @@ class RequestHandler(http.server.BaseHTTPRequestHandler): def is_cacheable(self): """Whether the requested file should be cached.""" - return self.path.endswith(".pkg.tar.xz") + # Support .pkg.tar.xz, .pkg.tar.zst, etc. + basename = os.path.splitext(self.path)[0] + return basename.endswith(".pkg.tar") def is_date_sensitive_request(self): """Whether the resource is ephemeral.""" |