aboutsummaryrefslogtreecommitdiffstats
path: root/test/mitmproxy/net/http/test_response.py
diff options
context:
space:
mode:
authorThomas Kriechbaumer <Kriechi@users.noreply.github.com>2020-06-08 19:35:32 +0200
committerGitHub <noreply@github.com>2020-06-08 19:35:32 +0200
commitbbc2cf331a4ab180001668bf4b51eeec505e01ab (patch)
treec11995d5a3b43252d741ed8bbd66cf47379e8d02 /test/mitmproxy/net/http/test_response.py
parent107b019b05798f97d2a0de8ef866ea6197975d9f (diff)
parent75ec05c85e597e66128c68c124f8a0376a5db7f2 (diff)
downloadmitmproxy-bbc2cf331a4ab180001668bf4b51eeec505e01ab.tar.gz
mitmproxy-bbc2cf331a4ab180001668bf4b51eeec505e01ab.tar.bz2
mitmproxy-bbc2cf331a4ab180001668bf4b51eeec505e01ab.zip
Merge pull request #4023 from rbdixon/http2_response_fix
HTTP2 response reason is None, render as '' in property.
Diffstat (limited to 'test/mitmproxy/net/http/test_response.py')
-rw-r--r--test/mitmproxy/net/http/test_response.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/mitmproxy/net/http/test_response.py b/test/mitmproxy/net/http/test_response.py
index 27c16be6..08d72840 100644
--- a/test/mitmproxy/net/http/test_response.py
+++ b/test/mitmproxy/net/http/test_response.py
@@ -77,6 +77,12 @@ class TestResponseCore:
resp.data.reason = b'cr\xe9e'
assert resp.reason == "crée"
+ # HTTP2 responses do not contain a reason phrase and self.data.reason will be None.
+ # This should render to an empty reason phrase so that functions
+ # expecting a string work properly.
+ resp.data.reason = None
+ assert resp.reason == ""
+
class TestResponseUtils:
"""