diff Lib/cgi.py @ 3958:b86c80448d35 legacy-trunk

For method=POST, append a query string from the environment or from sys.argv[1], effectively merging the fields.
author Guido van Rossum <guido@python.org>
date Thu, 08 Aug 1996 18:42:12 +0000
parents 51a7c8fe7c7b
children f66562536f11
line wrap: on
line diff
--- a/Lib/cgi.py	Thu Aug 08 18:40:59 1996 +0000
+++ b/Lib/cgi.py	Thu Aug 08 18:42:12 1996 +0000
@@ -439,6 +439,12 @@
 	    qs = fp.read(clength)
 	else:
 	    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
     elif environ.has_key('QUERY_STRING'):
 	qs = environ['QUERY_STRING']
@@ -961,7 +967,7 @@
 
     """
     def __init__(self, environ=os.environ):
-        self.dict = parse(environ)
+        self.dict = parse(environ=environ)
 	self.query_string = environ['QUERY_STRING']
     def __getitem__(self,key):
 	return self.dict[key]