diff options
author | Shadab Zafar <dufferzafar0@gmail.com> | 2016-09-06 11:40:41 +0530 |
---|---|---|
committer | Shadab Zafar <dufferzafar0@gmail.com> | 2016-09-27 16:44:09 +0530 |
commit | 90a48ccc06d01a13c52d8038b1300ff6b80a1292 (patch) | |
tree | a10dced901cd6ea5b98a27657dc7e0cd78ba5fbd /netlib | |
parent | 29046e6b4881bde9d8823a01879b8fe87bdf15e0 (diff) | |
download | mitmproxy-90a48ccc06d01a13c52d8038b1300ff6b80a1292.tar.gz mitmproxy-90a48ccc06d01a13c52d8038b1300ff6b80a1292.tar.bz2 mitmproxy-90a48ccc06d01a13c52d8038b1300ff6b80a1292.zip |
Rename _read_token to _read_key
Since we also have a _read_value
Diffstat (limited to 'netlib')
-rw-r--r-- | netlib/http/cookies.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/netlib/http/cookies.py b/netlib/http/cookies.py index 9b93e600..cdf742ce 100644 --- a/netlib/http/cookies.py +++ b/netlib/http/cookies.py @@ -57,13 +57,6 @@ def _read_until(s, start, term): return s[start:i + 1], i + 1 -def _read_token(s, start): - """ - Read a token - the LHS of a token/value pair in a cookie. - """ - return _read_until(s, start, ",;=") - - def _read_quoted_string(s, start): """ start: offset to the first quote of the string to be read @@ -91,6 +84,13 @@ def _read_quoted_string(s, start): return "".join(ret), i + 1 +def _read_key(s, start, delims=";="): + """ + Read a key - the LHS of a token/value pair in a cookie. + """ + return _read_until(s, start, delims) + + def _read_value(s, start, delims): """ Reads a value - the RHS of a token/value pair in a cookie. @@ -113,7 +113,7 @@ def _read_pairs(s, off=0): pairs = [] while True: - lhs, off = _read_token(s, off) + lhs, off = _read_key(s, off, ";=,") lhs = lhs.lstrip() if lhs: |