You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HTTP2: Expect: 100-Continue support and early response handling #26930
We need to add logic to the HTTP implementation to support Expect: 100-continue.
In particular:
(1) If the user sets this header, defer sending the request body until we receive a either a 100 continue, or the 100-continue timeout expires
(2) If instead we receive a final response, and the status code is >=300, we should reset the request stream and stop sending it (if we started due to the timeout expiring)
We should also consider doing (2) above even without Expect: 100-continue. We don't do this for HTTP/1.1 currently, but it's not clear to me why we don't.
@gmazzotti your post seems to be unrelated to this issue. This is about HTTP/2 support of 100-Continue. HTTP/2 is now being added, it is not something that exists.
I will hide your post as off-topic. Please feel free to file a new issue with description of a problem you have - simple repro and clear description what is wrong, or what you want to add would be great. Thanks!
(2) If instead we receive a final response, and the status code is >=300, we should reset the request stream and stop sending it (if we started due to the timeout expiring)
We should also consider doing (2) above even without Expect: 100-continue. We don't do this for HTTP/1.1 currently, but it's not clear to me why we don't.
Because for HTTP/1.1 that would close the socket and could lead to exhaustion. There's also a trade off for how long it takes to drain the request body vs how long it would take to establish a new socket connection (especially over TLS, proxies, etc). Using a request body drain timeout similar to the one for the response body might be a good compromise.
Note HttpWebRequest on 4.x has a mitigation for HTTP/1.1 chunked requests where it will send the chunked terminator instead of sending the request body for early 300+ response statuses. It also takes into account if the request body is buffered/re-transmittable, if not it will close the connection so that it can send the body only on the new request instead (e.g. auth, redirects, etc.).
Activity
geoffkizer commentedon Jul 24, 2018
For reference see the logic related to "hasExpectContinueHeader" in HttpConnection.SendAsyncCore.
gmazzotti commentedon Dec 11, 2018
karelz commentedon Feb 8, 2019
@gmazzotti your post seems to be unrelated to this issue. This is about HTTP/2 support of 100-Continue. HTTP/2 is now being added, it is not something that exists.
I will hide your post as off-topic. Please feel free to file a new issue with description of a problem you have - simple repro and clear description what is wrong, or what you want to add would be great. Thanks!
karelz commentedon Feb 27, 2019
@wfurt are you actively working on it? (it is assigned to you)
Tratcher commentedon Jun 14, 2019
Because for HTTP/1.1 that would close the socket and could lead to exhaustion. There's also a trade off for how long it takes to drain the request body vs how long it would take to establish a new socket connection (especially over TLS, proxies, etc). Using a request body drain timeout similar to the one for the response body might be a good compromise.
Tratcher commentedon Jun 14, 2019
Note HttpWebRequest on 4.x has a mitigation for HTTP/1.1 chunked requests where it will send the chunked terminator instead of sending the request body for early 300+ response statuses. It also takes into account if the request body is buffered/re-transmittable, if not it will close the connection so that it can send the body only on the new request instead (e.g. auth, redirects, etc.).
wfurt commentedon Jun 14, 2019
I was talking about some of the behavior with @mconnew in context of #26662. However, the current layering makes it somewhat challenging .
Tratcher commentedon Jun 14, 2019
Ah, yeah, WCF was the customer for the HttpWebRequest change as well.