From a4270efaf281dac9392f412739a6aa6fdda9a016 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Tue, 21 Feb 2012 13:00:45 +1300 Subject: [PATCH] Always return an ODict from get_query --- libmproxy/flow.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libmproxy/flow.py b/libmproxy/flow.py index 63f80dde4..f3bc39d8d 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -46,7 +46,7 @@ class ScriptContext: class ODict: """ - A dictionary-like object for managing ordered (key, value) data. + A dictionary-like object for managing ordered (key, value) data. """ def __init__(self, lst=None): self.lst = lst or [] @@ -149,7 +149,7 @@ class ODict: class ODictCaseless(ODict): """ A variant of ODict with "caseless" keys. This version _preserves_ key - case, but does not consider case when setting or getting items. + case, but does not consider case when setting or getting items. """ def _kconv(self, s): return s.lower() @@ -337,9 +337,9 @@ class Request(HTTPMsg): Gets the request query string. Returns an ODict object. """ _, _, _, _, query, _ = urlparse.urlparse(self.get_url()) - if not query: - return [] - return ODict(utils.urldecode(query)) + if query: + return ODict(utils.urldecode(query)) + return ODict([]) def set_query(self, odict): """