Handling half-closed HTTP/2 streams gracefully. #750
tomchristie
started this conversation in
General
Replies: 1 comment
-
Code import httpcore
pool = httpcore.ConnectionPool(http1=False, http2=True)
response = pool.request("GET", "http://127.0.0.1:80", content=b'1'*10_000_000) # fails
response = pool.request("GET", "http://127.0.0.1:80", content=b'1'*10) # ok Nginx conf
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Pull request #641 added support for handling HTTP/1.1 half-closed connections gracefully.
In plainer language... when the client sends a large request, the server can close the request pre-emptively "nope this is too big not going to accept it" and still send a valid response. "nope that was too big, I didn't accept it". It's more user friendly if the client can return that response rather than just raising an exception at the point the request was closed.
We probably want to handle the same case for HTTP/2, but... it'd be really helpful to be able to demonstrate it in the wild. Can anyone point at an example 413 request against an HTTP/2 server that we could use to verify this as a requirement?
Beta Was this translation helpful? Give feedback.
All reactions