1.1 --- a/WebStack/Webware.py Sat Apr 24 17:01:26 2004 +0000
1.2 +++ b/WebStack/Webware.py Sat Apr 24 20:33:31 2004 +0000
1.3 @@ -7,6 +7,7 @@
1.4 import Generic
1.5 from cgi import parse_qs
1.6 import StringIO
1.7 +from Helpers import Environment
1.8
1.9 class Transaction(Generic.Transaction):
1.10
1.11 @@ -54,7 +55,8 @@
1.12 def get_headers(self):
1.13
1.14 """
1.15 - A framework-specific method which returns all request headers.
1.16 + A framework-specific method which returns all request headers as a
1.17 + dictionary-like object mapping header names to values.
1.18 NOTE: If duplicate header names are permitted, then this interface will
1.19 NOTE: need to change.
1.20 """
1.21 @@ -63,13 +65,7 @@
1.22 # NOTE: Using lower case for the header names.
1.23
1.24 env = self.trans.request().environ()
1.25 - headers = {}
1.26 - for cgi_key, value in env.items():
1.27 - if cgi_key.startswith("HTTP_"):
1.28 - header_name = cgi_key[len("HTTP_"):].replace("_", "-").lower()
1.29 - headers[header_name] = value
1.30 -
1.31 - return headers
1.32 + return Environment.get_headers(env)
1.33
1.34 def get_header_values(self, key):
1.35
1.36 @@ -183,6 +179,8 @@
1.37 """
1.38 A framework-specific method which extracts user information from the
1.39 transaction.
1.40 +
1.41 + Returns a username as a string or None if no user is defined.
1.42 """
1.43
1.44 # NOTE: Webware relies entirely on a CGI-style environment where the