mirror of
https://github.com/vee1e/mitmproxy.git
synced 2026-09-01 18:27:18 +00:00
Check flow.killable before killing prior knowledge h2 connections. (#7514)
* check for killable flow * [autofix.ci] apply automated fixes * add test * changelog * restructure test * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
ca8df49519
commit
c5402a490a
3 changed files with 19 additions and 1 deletions
|
|
@ -17,6 +17,8 @@
|
|||
([#7497](https://github.com/mitmproxy/mitmproxy/pull/7497), @sujaldev)
|
||||
- Add mitmweb tutorial to docs.
|
||||
([#7509](https://github.com/mitmproxy/mitmproxy/pull/7509), @EstherRoeth)
|
||||
- Fixed a bug that caused mitmproxy to crash when loading prior knowledge h2 flows.
|
||||
([#7514](https://github.com/mitmproxy/mitmproxy/pull/7514), @sujaldev)
|
||||
|
||||
## 12 January 2025: mitmproxy 11.1.0
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ class DisableH2C:
|
|||
and f.request.http_version == "HTTP/2.0"
|
||||
)
|
||||
if is_connection_preface:
|
||||
f.kill()
|
||||
if f.killable:
|
||||
f.kill()
|
||||
logging.warning(
|
||||
"Initiating HTTP/2 connections with prior knowledge are currently not supported."
|
||||
)
|
||||
|
|
|
|||
|
|
@ -37,3 +37,18 @@ class TestDisableH2CleartextUpgrade:
|
|||
a.request(f)
|
||||
assert not f.killable
|
||||
assert f.error.msg == flow.Error.KILLED_MESSAGE
|
||||
|
||||
def test_non_killable_flows(self):
|
||||
with taddons.context() as tctx:
|
||||
a = disable_h2c.DisableH2C()
|
||||
tctx.configure(a)
|
||||
|
||||
f = tflow.tflow()
|
||||
f.request = tutils.treq(
|
||||
method=b"PRI",
|
||||
path=b"*",
|
||||
http_version=b"HTTP/2.0",
|
||||
)
|
||||
f.kill()
|
||||
|
||||
a.request(f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue