mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 15:37:45 +00:00
assume keep-alive for HTTP/2
This commit is contained in:
parent
9c3596219d
commit
6d8a315c5d
@ -167,7 +167,10 @@ def connection_close(http_version, headers):
|
||||
elif "keep-alive" in tokens:
|
||||
return False
|
||||
|
||||
return http_version != "HTTP/1.1" and http_version != b"HTTP/1.1"
|
||||
return http_version not in (
|
||||
"HTTP/1.1", b"HTTP/1.1",
|
||||
"HTTP/2.0", b"HTTP/2.0",
|
||||
)
|
||||
|
||||
|
||||
def expected_http_body_size(
|
||||
|
@ -146,6 +146,7 @@ def test_connection_close():
|
||||
headers = Headers()
|
||||
assert connection_close(b"HTTP/1.0", headers)
|
||||
assert not connection_close(b"HTTP/1.1", headers)
|
||||
assert not connection_close(b"HTTP/2.0", headers)
|
||||
|
||||
headers["connection"] = "keep-alive"
|
||||
assert not connection_close(b"HTTP/1.1", headers)
|
||||
|
Loading…
Reference in New Issue
Block a user