1.1 --- a/WebStack/BaseHTTPRequestHandler.py Sun Feb 08 16:35:13 2004 +0000
1.2 +++ b/WebStack/BaseHTTPRequestHandler.py Sun Feb 08 18:15:48 2004 +0000
1.3 @@ -5,6 +5,7 @@
1.4 """
1.5
1.6 import Generic
1.7 +from Helpers.Request import MessageBodyStream
1.8 from cgi import FieldStorage
1.9 from StringIO import StringIO
1.10
1.11 @@ -26,7 +27,7 @@
1.12 # Other attributes of interest in instances of this class.
1.13
1.14 self.content_type = None
1.15 - self.response_code = 100
1.16 + self.response_code = 200
1.17 self.content = StringIO()
1.18
1.19 def commit(self):
1.20 @@ -37,7 +38,8 @@
1.21 """
1.22
1.23 self.trans.send_response(self.response_code)
1.24 - self.trans.send_header("Content-Type", self.format_content_type(self.content_type))
1.25 + if self.content_type is not None:
1.26 + self.trans.send_header("Content-Type", self.format_content_type(self.content_type))
1.27 self.trans.end_headers()
1.28 self.content.seek(0)
1.29 self.trans.wfile.write(self.content.read())
1.30 @@ -51,7 +53,7 @@
1.31 the transaction.
1.32 """
1.33
1.34 - return self.trans.rfile
1.35 + return MessageBodyStream(self.trans.rfile, self.get_headers())
1.36
1.37 def get_request_method(self):
1.38
1.39 @@ -128,13 +130,15 @@
1.40
1.41 return FieldStorage(self.trans.rfile, keep_blank_values=1)
1.42
1.43 - def get_agent_information(self):
1.44 + def get_user(self):
1.45
1.46 """
1.47 - A framework-specific method which extracts agent information from
1.48 - the transaction.
1.49 + A framework-specific method which extracts user information from the
1.50 + transaction.
1.51 """
1.52
1.53 + # NOTE: Not implemented yet, but just pretend that there are no users.
1.54 +
1.55 return None
1.56
1.57 # Response-related methods.