Skip to content

aiohttp client support for Brotli compression #2270

@kakarukeys

Description

@kakarukeys

Long story short

Currently unable to read brotli-compressed response. Is the support on the roadmap?

Expected behaviour

Able to read.

Actual behaviour

awaiting response.text will raise
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe7 in position 5: invalid continuation byte

Steps to reproduce

import asyncio, aiohttp
run = asyncio.get_event_loop().run_until_complete

async def f():
    async with aiohttp.ClientSession(headers={'Accept-Encoding': 'br'}) as session:
        async with session.get("https://www.amazon.com") as resp:
            html = await resp.text()

run(f())

Your environment

Python 3.6.2
aiohttp==2.2.5
chardet==3.0.4
on Linux Mint 13

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions