mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
Handle invalid headers.
This commit is contained in:
parent
bb124e23b2
commit
87d05a95ff
@ -284,6 +284,8 @@ class ProxyHandler(tcp.BaseHandler):
|
||||
raise ProxyError(400, "Bad HTTP request line: %s"%repr(line))
|
||||
method, path, httpversion = r
|
||||
headers = http.read_headers(self.rfile)
|
||||
if headers is None:
|
||||
raise ProxyError(400, "Invalid headers")
|
||||
content = http.read_http_body_request(
|
||||
self.rfile, self.wfile, headers, httpversion, self.config.body_size_limit
|
||||
)
|
||||
@ -298,6 +300,8 @@ class ProxyHandler(tcp.BaseHandler):
|
||||
raise ProxyError(400, "Bad HTTP request line: %s"%repr(line))
|
||||
method, path, httpversion = r
|
||||
headers = http.read_headers(self.rfile)
|
||||
if headers is None:
|
||||
raise ProxyError(400, "Invalid headers")
|
||||
content = http.read_http_body_request(
|
||||
self.rfile, self.wfile, headers, httpversion, self.config.body_size_limit
|
||||
)
|
||||
@ -337,6 +341,8 @@ class ProxyHandler(tcp.BaseHandler):
|
||||
raise ProxyError(400, "Bad HTTP request line: %s"%repr(line))
|
||||
method, path, httpversion = r
|
||||
headers = http.read_headers(self.rfile)
|
||||
if headers is None:
|
||||
raise ProxyError(400, "Invalid headers")
|
||||
content = http.read_http_body_request(
|
||||
self.rfile, self.wfile, headers, httpversion, self.config.body_size_limit
|
||||
)
|
||||
@ -347,6 +353,8 @@ class ProxyHandler(tcp.BaseHandler):
|
||||
raise ProxyError(400, "Bad HTTP request line: %s"%repr(line))
|
||||
method, scheme, host, port, path, httpversion = http.parse_init_proxy(line)
|
||||
headers = http.read_headers(self.rfile)
|
||||
if headers is None:
|
||||
raise ProxyError(400, "Invalid headers")
|
||||
content = http.read_http_body_request(
|
||||
self.rfile, self.wfile, headers, httpversion, self.config.body_size_limit
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user