diff options
| author | arjun23496 <arjun.k018@gmail.com> | 2016-08-29 16:50:14 +0530 |
|---|---|---|
| committer | arjun23496 <arjun.k018@gmail.com> | 2016-08-29 16:50:14 +0530 |
| commit | 99744cc780a5100ac028bbbf43e8a42e1167047e (patch) | |
| tree | f79f04daba1a3b2af987a23ec7d6d66c59473c9a /netlib/http/request.py | |
| parent | 70f94c7171cac9659feccfb0f974f72d4bc33a80 (diff) | |
| download | mitmproxy-99744cc780a5100ac028bbbf43e8a42e1167047e.tar.gz mitmproxy-99744cc780a5100ac028bbbf43e8a42e1167047e.tar.bz2 mitmproxy-99744cc780a5100ac028bbbf43e8a42e1167047e.zip | |
Added replace for request and headers - Fixed missing replace option
Diffstat (limited to 'netlib/http/request.py')
| -rw-r--r-- | netlib/http/request.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/netlib/http/request.py b/netlib/http/request.py index 666a5869..e0aaa8a9 100644 --- a/netlib/http/request.py +++ b/netlib/http/request.py @@ -80,7 +80,7 @@ class Request(message.Message): self.method, hostport, path ) - def replace(self, pattern, repl, flags=0): + def replace(self, pattern, repl, flags=0, count=0): """ Replaces a regular expression pattern with repl in the headers, the request path and the body of the request. Encoded content will be @@ -94,9 +94,9 @@ class Request(message.Message): if isinstance(repl, six.text_type): repl = strutils.escaped_str_to_bytes(repl) - c = super(Request, self).replace(pattern, repl, flags) + c = super(Request, self).replace(pattern, repl, flags, count) self.path, pc = re.subn( - pattern, repl, self.data.path, flags=flags + pattern, repl, self.data.path, flags=flags, count=count ) c += pc return c |
