aboutsummaryrefslogtreecommitdiffstats
path: root/test/netlib/http/test_headers.py
diff options
context:
space:
mode:
authorThomas Kriechbaumer <Kriechi@users.noreply.github.com>2016-08-31 13:49:03 +0200
committerGitHub <noreply@github.com>2016-08-31 13:49:03 +0200
commitb4b2e5fd3431ea3c8b8f00b8f92e8c7fc6f309ae (patch)
tree6ce6930f0f2db77c7d90bb940b359f4ea5eded73 /test/netlib/http/test_headers.py
parent6afbfc85266e783b1bad432ae1f6715bfb16a39f (diff)
parenta8deed1f4ef5992b1c9c74ac69491bdb5f0e8490 (diff)
downloadmitmproxy-b4b2e5fd3431ea3c8b8f00b8f92e8c7fc6f309ae.tar.gz
mitmproxy-b4b2e5fd3431ea3c8b8f00b8f92e8c7fc6f309ae.tar.bz2
mitmproxy-b4b2e5fd3431ea3c8b8f00b8f92e8c7fc6f309ae.zip
Merge pull request #1511 from arjun23496/count_in_replace
Fixes #1495 - Added count argument for replacing contents in body
Diffstat (limited to 'test/netlib/http/test_headers.py')
-rw-r--r--test/netlib/http/test_headers.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/netlib/http/test_headers.py b/test/netlib/http/test_headers.py
index 51537310..ad2bc548 100644
--- a/test/netlib/http/test_headers.py
+++ b/test/netlib/http/test_headers.py
@@ -75,6 +75,11 @@ class TestHeaders(object):
assert replacements == 0
assert headers["Host"] == "example.com"
+ def test_replace_with_count(self):
+ headers = Headers(Host="foobarfoo.com", Accept="foo/bar")
+ replacements = headers.replace("foo", "bar", count=1)
+ assert replacements == 1
+
def test_parse_content_type():
p = parse_content_type