From 2ad7014666202f640f1a57ba4590cc9819fbfcaf Mon Sep 17 00:00:00 2001 From: Channel Cat Date: Sun, 2 Oct 2016 22:31:31 -0700 Subject: [PATCH] Args should be an empty dict if none exist --- sanic/server.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sanic/server.py b/sanic/server.py index f7ca5225..0ca92a13 100644 --- a/sanic/server.py +++ b/sanic/server.py @@ -59,8 +59,11 @@ class Request: @property def args(self): - if not self.parsed_args and self.query_string: - self.parsed_args = {k:v if len(v)>1 else v[0] for k,v in parse_qs(self.query_string).items()} + if self.parsed_args is None: + if self.query_string: + self.parsed_args = {k:v if len(v)>1 else v[0] for k,v in parse_qs(self.query_string).items()} + else: + self.parsed_args = {} return self.parsed_args