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.
2.1 --- a/WebStack/Generic.py Sun Feb 08 16:35:13 2004 +0000
2.2 +++ b/WebStack/Generic.py Sun Feb 08 18:15:48 2004 +0000
2.3 @@ -174,14 +174,14 @@
2.4
2.5 raise NotImplementedError, "get_fields"
2.6
2.7 - def get_agent_information(self):
2.8 + def get_user(self):
2.9
2.10 """
2.11 - A framework-specific method which extracts agent information from
2.12 - the transaction.
2.13 + A framework-specific method which extracts user information from the
2.14 + transaction.
2.15 """
2.16
2.17 - raise NotImplementedError, "get_agent_information"
2.18 + raise NotImplementedError, "get_user"
2.19
2.20 # Response-related methods.
2.21
3.1 --- a/WebStack/ModPython.py Sun Feb 08 16:35:13 2004 +0000
3.2 +++ b/WebStack/ModPython.py Sun Feb 08 18:15:48 2004 +0000
3.3 @@ -104,14 +104,14 @@
3.4
3.5 return FieldStorage(self.trans, keep_blank_values=1)
3.6
3.7 - def get_agent_information(self):
3.8 + def get_user(self):
3.9
3.10 """
3.11 - A framework-specific method which extracts agent information from
3.12 - the transaction.
3.13 + A framework-specific method which extracts user information from the
3.14 + transaction.
3.15 """
3.16
3.17 - return None
3.18 + return self.trans.user
3.19
3.20 # Response-related methods.
3.21
4.1 --- a/WebStack/Twisted.py Sun Feb 08 16:35:13 2004 +0000
4.2 +++ b/WebStack/Twisted.py Sun Feb 08 18:15:48 2004 +0000
4.3 @@ -107,13 +107,15 @@
4.4
4.5 return dict([(key, value[0]) for (key, value) in self.trans.args.items()])
4.6
4.7 - def get_agent_information(self):
4.8 + def get_user(self):
4.9
4.10 """
4.11 - A framework-specific method which extracts agent information from
4.12 - the transaction.
4.13 + A framework-specific method which extracts user information from the
4.14 + transaction.
4.15 """
4.16
4.17 + # NOTE: Not implemented yet, but just pretend that there are no users.
4.18 +
4.19 return None
4.20
4.21 # Response-related methods.
5.1 --- a/WebStack/Webware.py Sun Feb 08 16:35:13 2004 +0000
5.2 +++ b/WebStack/Webware.py Sun Feb 08 18:15:48 2004 +0000
5.3 @@ -112,14 +112,14 @@
5.4
5.5 return self.trans.request().fields()
5.6
5.7 - def get_agent_information(self):
5.8 + def get_user(self):
5.9
5.10 """
5.11 - A framework-specific method which extracts agent information from
5.12 - the transaction.
5.13 + A framework-specific method which extracts user information from the
5.14 + transaction.
5.15 """
5.16
5.17 - return None
5.18 + return self.trans.request().remoteUser()
5.19
5.20 # Response-related methods.
5.21