Add gzip support to Data Layer download client (#14320)

add gzip
This commit is contained in:
Chida82 2023-01-17 19:15:49 +01:00 committed by GitHub
parent c7eeaa64e6
commit f7d6084dad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -145,7 +145,10 @@ async def insert_from_delta_file(
try:
async with aiohttp.ClientSession() as session:
async with session.get(server_info.url + "/" + filename, timeout=timeout, proxy=proxy_url) as resp:
headers = {"accept-encoding": "gzip"}
async with session.get(
server_info.url + "/" + filename, headers=headers, timeout=timeout, proxy=proxy_url
) as resp:
resp.raise_for_status()
size = int(resp.headers.get("content-length", 0))
log.debug(f"Downloading delta file {filename}. Size {size} bytes.")