-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing response content if header "Upgrade: h2,h2c" and "Connection: Upgrade" are available #2277
Comments
aiohttp doesn't support HTTP/2 yet. Please describe what response do you request for the case. |
Lack of HTTP/2 is not the problem. Problem is that the HTTP client is not ignore the request for HTTP2 from the webserver. |
Hi, I am having the same error with Testcase: |
Would you provide a Pull Request with fix? |
Unfortunately I am really a beginner in asynchronous python and just by change came across this error. |
Cannot reproduce on aiohttp master, both Cython and Pure Python parsers. I've tried a code from https://gist.github.com/Findus23/3aaedbac0dd2520a9b65d0c9a6431b22 |
That's really odd. Exact steps to reproduce
|
#2588 seems to fix the issue for me:
|
Fixed on master. |
Isn't the issue that without #2588 the response isn't handled correctly? |
Quoting @fafhrd91:
aiohttp client ignores HTTP/2 upgrade responses and continues to work on HTTP/1.1 protocol version. |
I think this is the problem https://github.com/aio-libs/aiohttp/blob/master/aiohttp/http_parser.py#L327 if server tries to upgrade connection to http/2, it sends "connection: upgrade" and "upgrade: h2" headers. aiohttp in this case mark connection as upgraded and tries to use custom parser (i.e. websocket) that is my understanding of this issue |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
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
Your environment
OS: Linux (Fedora)
aiohttp version: 2.2.5
uvloop is set as asyncio event loop
The text was updated successfully, but these errors were encountered: