aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/http_cookies.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2015-04-14 10:13:03 +1200
committerAldo Cortesi <aldo@nullcube.com>2015-04-14 10:13:03 +1200
commit6db5e0a4a133e6e6150f9cab87cd56b40d6db0b2 (patch)
tree3f8a311aed46608498ea2c43762bf1e15e9df87e /netlib/http_cookies.py
parentde9e7411253c4f67ea4d0b96f6f9e952024c5fa3 (diff)
downloadmitmproxy-6db5e0a4a133e6e6150f9cab87cd56b40d6db0b2.tar.gz
mitmproxy-6db5e0a4a133e6e6150f9cab87cd56b40d6db0b2.tar.bz2
mitmproxy-6db5e0a4a133e6e6150f9cab87cd56b40d6db0b2.zip
Remove old-style set-cookie cruft, unit tests to 100%
Diffstat (limited to 'netlib/http_cookies.py')
-rw-r--r--netlib/http_cookies.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/netlib/http_cookies.py b/netlib/http_cookies.py
index a1f240f5..297efb80 100644
--- a/netlib/http_cookies.py
+++ b/netlib/http_cookies.py
@@ -88,14 +88,12 @@ def _read_value(s, start, delims):
return _read_until(s, start, delims)
-def _read_pairs(s, off=0, term=None, specials=()):
+def _read_pairs(s, off=0, specials=()):
"""
Read pairs of lhs=rhs values.
off: start offset
- term: if True, treat a comma as a terminator for the pairs lists
- specials: a lower-cased list of keys that may contain commas if term is
- True
+ specials: a lower-cased list of keys that may contain commas
"""
vals = []
while 1:
@@ -105,17 +103,11 @@ def _read_pairs(s, off=0, term=None, specials=()):
rhs = None
if off < len(s):
if s[off] == "=":
- if term and lhs.lower() not in specials:
- delims = ";,"
- else:
- delims = ";"
- rhs, off = _read_value(s, off+1, delims)
+ rhs, off = _read_value(s, off+1, ";")
vals.append([lhs, rhs])
off += 1
if not off < len(s):
break
- if term and s[off-1] == ",":
- break
return vals, off