65 lines
3.3 KiB
Diff
65 lines
3.3 KiB
Diff
diff -Nur mitmproxy-7.0.0/mitmproxy/contentviews/__init__.py mitmproxy-7.0.0-1/mitmproxy/contentviews/__init__.py
|
|
--- mitmproxy-7.0.0/mitmproxy/contentviews/__init__.py 2021-07-16 16:24:38.000000000 +0800
|
|
+++ mitmproxy-7.0.0-1/mitmproxy/contentviews/__init__.py 2021-08-04 15:27:39.221691053 +0800
|
|
@@ -99,8 +99,10 @@
|
|
http_message = None
|
|
if isinstance(message, http.Message):
|
|
http_message = message
|
|
- if ctype := message.headers.get("content-type"):
|
|
- if ct := http.parse_content_type(ctype):
|
|
+ ctype_tmp = message.headers.get("content-type")
|
|
+ if ctype == ctype_tmp:
|
|
+ ct_tmp = http.parse_content_type(ctype)
|
|
+ if ct == ct_tmp:
|
|
content_type = f"{ct[0]}/{ct[1]}"
|
|
|
|
description, lines, error = get_content_view(
|
|
diff -Nur mitmproxy-7.0.0/mitmproxy/net/tls.py mitmproxy-7.0.0-1/mitmproxy/net/tls.py
|
|
--- mitmproxy-7.0.0/mitmproxy/net/tls.py 2021-07-16 16:24:38.000000000 +0800
|
|
+++ mitmproxy-7.0.0-1/mitmproxy/net/tls.py 2021-08-04 15:32:53.086778204 +0800
|
|
@@ -106,7 +106,7 @@
|
|
ok += SSL._lib.SSL_CTX_set_max_proto_version(context._context, max_version.value) # type: ignore
|
|
if ok != 2:
|
|
raise RuntimeError(
|
|
- f"Error setting TLS versions ({min_version=}, {max_version=}). "
|
|
+ f"Error setting TLS versions ({min_version}, {max_version}). "
|
|
"The version you specified may be unavailable in your libssl."
|
|
)
|
|
|
|
@@ -177,7 +177,7 @@
|
|
try:
|
|
context.load_verify_locations(ca_pemfile, ca_path)
|
|
except SSL.Error as e:
|
|
- raise RuntimeError(f"Cannot load trusted certificates ({ca_pemfile=}, {ca_path=}).") from e
|
|
+ raise RuntimeError(f"Cannot load trusted certificates ({ca_pemfile}, {ca_path}).") from e
|
|
|
|
# Client Certs
|
|
if client_cert:
|
|
diff -Nur mitmproxy-7.0.0/mitmproxy/proxy/layers/http/__init__.py mitmproxy-7.0.0-1/mitmproxy/proxy/layers/http/__init__.py
|
|
--- mitmproxy-7.0.0/mitmproxy/proxy/layers/http/__init__.py 2021-07-16 16:24:38.000000000 +0800
|
|
+++ mitmproxy-7.0.0-1/mitmproxy/proxy/layers/http/__init__.py 2021-08-04 15:30:16.424239006 +0800
|
|
@@ -148,8 +148,8 @@
|
|
else:
|
|
self.flow = event.replay_flow
|
|
self.flow.request = event.request
|
|
-
|
|
- if err := validate_request(self.mode, self.flow.request):
|
|
+ err_tmp = validate_request(self.mode, self.flow.request)
|
|
+ if err == err_tmp:
|
|
self.flow.response = http.Response.make(502, str(err))
|
|
self.client_state = self.state_errored
|
|
return (yield from self.send_response())
|
|
diff -Nur mitmproxy-7.0.0/mitmproxy/proxy/server.py mitmproxy-7.0.0-1/mitmproxy/proxy/server.py
|
|
--- mitmproxy-7.0.0/mitmproxy/proxy/server.py 2021-07-16 16:24:38.000000000 +0800
|
|
+++ mitmproxy-7.0.0-1/mitmproxy/proxy/server.py 2021-08-04 15:31:48.925738277 +0800
|
|
@@ -142,7 +142,8 @@
|
|
server=command.connection
|
|
)
|
|
await self.handle_hook(server_hooks.ServerConnectHook(hook_data))
|
|
- if err := command.connection.error:
|
|
+ err_tmp = command.connection.error
|
|
+ if err == err_tmp:
|
|
self.log(f"server connection to {human.format_address(command.connection.address)} killed before connect: {err}")
|
|
self.server_event(events.OpenConnectionCompleted(command, f"Connection killed: {err}"))
|
|
return
|