Commit 8d9b60f1 authored by Brett Cannon's avatar Brett Cannon

Change parse_qsl() to accept control-name's with no equal sign (e.g., "name")

when keep_blank_values is true.
parent cbddabfd
...@@ -213,6 +213,10 @@ def parse_qsl(qs, keep_blank_values=0, strict_parsing=0): ...@@ -213,6 +213,10 @@ def parse_qsl(qs, keep_blank_values=0, strict_parsing=0):
if len(nv) != 2: if len(nv) != 2:
if strict_parsing: if strict_parsing:
raise ValueError, "bad query field: %r" % (name_value,) raise ValueError, "bad query field: %r" % (name_value,)
# Handle case of a control-name with no equal sign
if keep_blank_values:
nv.append('')
else:
continue continue
if len(nv[1]) or keep_blank_values: if len(nv[1]) or keep_blank_values:
name = urllib.unquote(nv[0].replace('+', ' ')) name = urllib.unquote(nv[0].replace('+', ' '))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment