From 9737288e6b95ea31f64e888b74d800924bbb25ef Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Mon, 5 Aug 2024 10:15:37 +1000 Subject: [PATCH] Fix tests for aiohttp 3.10 aiohttp 3.10 changed the server's handling of content-type/encoding headers for compressed files. This affects our usage of aiohttp.test_utils.TestServer: gzip-compressed files are no longer being decompressed by default. This in itself is not a problem, but the MIME type used ("application/gzip") did not match our client's list of automatically handled MIME types. Add it to the list to handle it in the same way as others. This fixes test_cmd::yum with aiohttp=>3.10. --- repo_autoindex/_impl/api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/repo_autoindex/_impl/api.py b/repo_autoindex/_impl/api.py index c7ee2c3..93db7f8 100644 --- a/repo_autoindex/_impl/api.py +++ b/repo_autoindex/_impl/api.py @@ -40,6 +40,7 @@ def http_fetcher(session: aiohttp.ClientSession) -> Fetcher: # Deal with the non-ideal content negotiation # for certain storage backends. if url.endswith(".gz") and resp.content_type in ( + "application/gzip", "application/x-gzip", "application/octet-stream", ):