1.1 --- a/WebStack/Twisted.py Fri Jun 20 22:21:30 2008 +0200
1.2 +++ b/WebStack/Twisted.py Sun Feb 15 16:05:35 2004 +0000
1.3 @@ -41,13 +41,23 @@
1.4 def get_headers(self):
1.5
1.6 """
1.7 - A framework-specific method which returns the request headers.
1.8 - NOTE: Experimental, since framework support varies somewhat.
1.9 + A framework-specific method which returns all request headers.
1.10 """
1.11
1.12 - # NOTE: Accessing attribute of transaction object.
1.13 + return self.trans.received_headers
1.14 +
1.15 + def get_header_values(self, key):
1.16
1.17 - return self.trans.received_headers
1.18 + """
1.19 + A framework-specific method which returns a list of all request header
1.20 + values associated with the given 'key'. Note that according to RFC 2616,
1.21 + 'key' is treated as a case-insensitive string.
1.22 + """
1.23 +
1.24 + # Twisted does not convert the header key to lower case (which is the
1.25 + # stored representation).
1.26 +
1.27 + return self.convert_to_list(self.trans.received_headers.get(key.lower()))
1.28
1.29 def get_content_type(self):
1.30