Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport bpo-44022: Fix http client infinite line reading (DoS) after…
… a HTTP 100 Continue (pythonGH-25916) Backport the fix from the following commit: commit 47895e3 Author: Gen Xu <xgbarry@gmail.com> Date: 2021-05-06 00:42:41 +0200 bpo-44022: Fix http client infinite line reading (DoS) after a HTTP 100 Continue (pythonGH-25916) Fixes http.client potential denial of service where it could get stuck reading lines from a malicious server after a 100 Continue response. Co-authored-by: Gregory P. Smith <greg@krypto.org> Instead of reusing the header reading code, I have just added explicit counter to avoid having to refactor the old code. Plus the improved test from: commit e60ab84 Author: Gregory P. Smith <greg@krypto.org> Date: 2021-06-03 05:43:38 +0200 bpo-44022: Improve the regression test. (pythonGH-26503) It wasn't actually detecting the regression due to the assertion being too lenient.
- Loading branch information