From 90a48ccc06d01a13c52d8038b1300ff6b80a1292 Mon Sep 17 00:00:00 2001 From: Shadab Zafar Date: Tue, 6 Sep 2016 11:40:41 +0530 Subject: [PATCH] Rename _read_token to _read_key Since we also have a _read_value --- netlib/http/cookies.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/netlib/http/cookies.py b/netlib/http/cookies.py index 9b93e600c..cdf742ce1 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: