mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
For method=POST, append a query string from the environment or from
sys.argv[1], effectively merging the fields.
This commit is contained in:
parent
306a8a6338
commit
afb5e93e77
1 changed files with 7 additions and 1 deletions
|
@ -439,6 +439,12 @@ def parse(fp=None, environ=os.environ, keep_blank_values=None):
|
||||||
qs = fp.read(clength)
|
qs = fp.read(clength)
|
||||||
else:
|
else:
|
||||||
qs = '' # Unknown content-type
|
qs = '' # Unknown content-type
|
||||||
|
if environ.has_key('QUERY_STRING'):
|
||||||
|
if qs: qs = qs + '&'
|
||||||
|
qs = qs + environ['QUERY_STRING']
|
||||||
|
elif sys.argv[1:]:
|
||||||
|
if qs: qs = qs + '&'
|
||||||
|
qs = qs + sys.argv[1]
|
||||||
environ['QUERY_STRING'] = qs # XXX Shouldn't, really
|
environ['QUERY_STRING'] = qs # XXX Shouldn't, really
|
||||||
elif environ.has_key('QUERY_STRING'):
|
elif environ.has_key('QUERY_STRING'):
|
||||||
qs = environ['QUERY_STRING']
|
qs = environ['QUERY_STRING']
|
||||||
|
@ -961,7 +967,7 @@ class FormContentDict:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
def __init__(self, environ=os.environ):
|
def __init__(self, environ=os.environ):
|
||||||
self.dict = parse(environ)
|
self.dict = parse(environ=environ)
|
||||||
self.query_string = environ['QUERY_STRING']
|
self.query_string = environ['QUERY_STRING']
|
||||||
def __getitem__(self,key):
|
def __getitem__(self,key):
|
||||||
return self.dict[key]
|
return self.dict[key]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue