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.
This commit is contained in:
Rohan McGovern 2024-08-05 10:15:37 +10:00
parent 5636a90eea
commit 9737288e6b

View file

@ -40,6 +40,7 @@ def http_fetcher(session: aiohttp.ClientSession) -> Fetcher:
# Deal with the non-ideal content negotiation # Deal with the non-ideal content negotiation
# for certain storage backends. # for certain storage backends.
if url.endswith(".gz") and resp.content_type in ( if url.endswith(".gz") and resp.content_type in (
"application/gzip",
"application/x-gzip", "application/x-gzip",
"application/octet-stream", "application/octet-stream",
): ):