1.1 --- a/WebStack/BaseHTTPRequestHandler.py Wed Feb 25 22:30:35 2004 +0000
1.2 +++ b/WebStack/BaseHTTPRequestHandler.py Sat Feb 28 16:29:51 2004 +0000
1.3 @@ -7,7 +7,7 @@
1.4 import Generic
1.5 from Helpers.Request import MessageBodyStream
1.6 from Helpers.Auth import UserInfo
1.7 -from cgi import FieldStorage
1.8 +from cgi import parse_qs, FieldStorage
1.9 from StringIO import StringIO
1.10
1.11 class Transaction(Generic.Transaction):
1.12 @@ -128,9 +128,9 @@
1.13 request.
1.14 """
1.15
1.16 - # NOTE: No attempt is made to deduce the "path info".
1.17 + # Remove the query string from the end of the path.
1.18
1.19 - return self.trans.path
1.20 + return self.trans.path.split("?")[0]
1.21
1.22 def get_query_string(self):
1.23
1.24 @@ -157,16 +157,11 @@
1.25 path specified in the transaction. The underlying framework may refuse
1.26 to supply fields from the path if handling a POST transaction.
1.27
1.28 - The returned object should employ the cgi.FieldStorage interface.
1.29 + Returns a dictionary mapping field names to lists of values (even if a
1.30 + single value is associated with any given field name).
1.31 """
1.32
1.33 - # NOTE: Since the cgi.FieldStorage class employed in this implementation
1.34 - # NOTE: will only provide fields from the path for GET transactions, the
1.35 - # NOTE: environment is adjusted to persuade it to give the desired
1.36 - # NOTE: output.
1.37 -
1.38 - return FieldStorage(headers=self.get_headers(), environ={"REQUEST_METHOD" : "GET",
1.39 - "QUERY_STRING" : self.get_query_string()}, keep_blank_values=1)
1.40 + return parse_qs(self.get_query_string(), keep_blank_values=1)
1.41
1.42 def get_fields_from_body(self):
1.43