From 1f2cdfc601d43f18a1b738ddbac382726759fa0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 17 Nov 2022 12:29:33 +0100 Subject: [PATCH] chore(contrib): Mitmproxy 9 has removed the HTTP prefix from the Response type --- contrib/mitmproxy/failures.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/mitmproxy/failures.py b/contrib/mitmproxy/failures.py index 28b31b11d..be4460928 100644 --- a/contrib/mitmproxy/failures.py +++ b/contrib/mitmproxy/failures.py @@ -30,13 +30,13 @@ def timeout(flow): # hold a tuple containing a function that may or may not create a failure and # the probability weight at which rate this failure should be triggered. # -# The method should return an http.HTTPResponse if it should modify the +# The method should return an http.Response if it should modify the # response or None if the response should be passed as is. FAILURES = { "Success": (lambda x: None, 50), "Gateway error": - (lambda _: http.HTTPResponse.make(500, b"Gateway error"), 20), - "Limit exeeded": (lambda _: http.HTTPResponse.make( + (lambda _: http.Response.make(500, b"Gateway error"), 20), + "Limit exeeded": (lambda _: http.Response.make( 429, json.dumps({ "errcode": "M_LIMIT_EXCEEDED",