mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-29 20:55:03 +08:00
remove FIXME
This commit is contained in:
@@ -158,8 +158,9 @@ def connection_close(http_version, headers):
|
|||||||
"""
|
"""
|
||||||
Checks the message to see if the client connection should be closed
|
Checks the message to see if the client connection should be closed
|
||||||
according to RFC 2616 Section 8.1.
|
according to RFC 2616 Section 8.1.
|
||||||
|
If we don't have a Connection header, HTTP 1.1 connections are assumed
|
||||||
|
to be persistent.
|
||||||
"""
|
"""
|
||||||
# At first, check if we have an explicit Connection header.
|
|
||||||
if "connection" in headers:
|
if "connection" in headers:
|
||||||
tokens = get_header_tokens(headers, "connection")
|
tokens = get_header_tokens(headers, "connection")
|
||||||
if "close" in tokens:
|
if "close" in tokens:
|
||||||
@@ -167,9 +168,7 @@ def connection_close(http_version, headers):
|
|||||||
elif "keep-alive" in tokens:
|
elif "keep-alive" in tokens:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# If we don't have a Connection header, HTTP 1.1 connections are assumed to
|
return http_version != "HTTP/1.1" and http_version != b"HTTP/1.1"
|
||||||
# be persistent
|
|
||||||
return http_version != "HTTP/1.1" and http_version != b"HTTP/1.1" # FIXME: Remove one case.
|
|
||||||
|
|
||||||
|
|
||||||
def expected_http_body_size(request, response=None):
|
def expected_http_body_size(request, response=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user