Skip to content

Missing response content if header "Upgrade: h2,h2c" and "Connection: Upgrade" are available #2277

Closed
@segal90

Description

Long story short

Content of a POST response is None or b'' (based on how do you want access the response content) if "Upgrade: h2,h2c" and "Connection: Upgrade" headers are in the HTTP response.
After disable Apache's mod_http2 everything works like a charm.

Expected behaviour

Ignore these headers or handle correctly the HTTP2 upgrade request but not ignore the response body.

Actual behaviour

Response body is ignored

Steps to reproduce

  1. configure an Apache with mod_http2
  2. run this code snippet:
auth = aiohttp.BasicAuth('user1', 'VerySecretPassword')
data = {'just': 'some', 'dummy': 'data'}
async with aiohttp.ClientSession(auth=auth, conn_timeout=10) as session:
    async with session.post(<SERVER_ADDRESS>, data=data) as response:
        print(await response.json()) 

Your environment

OS: Linux (Fedora)
aiohttp version: 2.2.5
uvloop is set as asyncio event loop

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions