aboutsummaryrefslogtreecommitdiffstats
path: root/examples/complex
diff options
context:
space:
mode:
Diffstat (limited to 'examples/complex')
-rw-r--r--examples/complex/change_upstream_proxy.py2
-rw-r--r--examples/complex/sslstrip.py1
-rwxr-xr-xexamples/complex/xss_scanner.py2
3 files changed, 4 insertions, 1 deletions
diff --git a/examples/complex/change_upstream_proxy.py b/examples/complex/change_upstream_proxy.py
index 089a9df5..a0e7e572 100644
--- a/examples/complex/change_upstream_proxy.py
+++ b/examples/complex/change_upstream_proxy.py
@@ -24,4 +24,4 @@ def request(flow: http.HTTPFlow) -> None:
return
address = proxy_address(flow)
if flow.live:
- flow.live.change_upstream_proxy_server(address)
+ flow.live.change_upstream_proxy_server(address) # type: ignore
diff --git a/examples/complex/sslstrip.py b/examples/complex/sslstrip.py
index 69b9ea9e..8b904216 100644
--- a/examples/complex/sslstrip.py
+++ b/examples/complex/sslstrip.py
@@ -31,6 +31,7 @@ def request(flow: http.HTTPFlow) -> None:
def response(flow: http.HTTPFlow) -> None:
+ assert flow.response
flow.response.headers.pop('Strict-Transport-Security', None)
flow.response.headers.pop('Public-Key-Pins', None)
diff --git a/examples/complex/xss_scanner.py b/examples/complex/xss_scanner.py
index d5f4aaab..2a45511a 100755
--- a/examples/complex/xss_scanner.py
+++ b/examples/complex/xss_scanner.py
@@ -395,8 +395,10 @@ def get_XSS_data(body: Union[str, bytes], request_URL: str, injection_point: str
# response is mitmproxy's entry point
def response(flow: http.HTTPFlow) -> None:
+ assert flow.response
cookies_dict = get_cookies(flow)
resp = flow.response.get_text(strict=False)
+ assert resp
# Example: http://xss.guru/unclaimedScriptTag.html
find_unclaimed_URLs(resp, flow.request.url)
results = test_end_of_URL_injection(resp, flow.request.url, cookies_dict)