]> git.ipfire.org Git - thirdparty/starlette.git/commit
Replace task cancellation in `BaseHTTPMiddleware` with `http.disconnect`+`recv_stream...
authorJean Hominal <jhominal@gmail.com>
Sat, 24 Sep 2022 05:29:08 +0000 (07:29 +0200)
committerGitHub <noreply@github.com>
Sat, 24 Sep 2022 05:29:08 +0000 (07:29 +0200)
commit040d8c86b09f34be49e8c253d97a588973bc7308
tree632176fcd00440f7035229a0801c0c8033550351
parent70971eac55e5c8821d9e6af5fcf7bb995cc10570
Replace task cancellation in `BaseHTTPMiddleware` with `http.disconnect`+`recv_stream.close` (#1715)

* replace BaseMiddleware cancellation after request send with closing recv_stream + http.disconnect in receive

fixes #1438

* Add no cover pragma on pytest.fail in tests/middleware/test_base.py

Co-authored-by: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
* make http_disconnect_while_sending test more robust in the face of scheduling issues

* Fix issue with running middleware context manager

Reported in https://github.com/encode/starlette/issues/1678#issuecomment-1172916042

Co-authored-by: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
starlette/middleware/base.py
tests/middleware/test_base.py