1.1 --- a/WebStack/Helpers/Environment.py Thu Sep 27 22:36:39 2007 +0000
1.2 +++ b/WebStack/Helpers/Environment.py Thu Sep 27 22:36:59 2007 +0000
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Environment helper functions.
1.6
1.7 -Copyright (C) 2004, 2005 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2004, 2005, 2007 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This library is free software; you can redistribute it and/or
1.11 modify it under the terms of the GNU Lesser General Public
1.12 @@ -20,6 +20,8 @@
1.13 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
1.14 """
1.15
1.16 +cgi_names = ("CONTENT_LENGTH", "CONTENT_TYPE")
1.17 +
1.18 def get_headers(env):
1.19
1.20 """
1.21 @@ -34,6 +36,9 @@
1.22 if cgi_key.startswith("HTTP_"):
1.23 header_name = cgi_key[len("HTTP_"):].replace("_", "-").lower()
1.24 headers[header_name] = value
1.25 + elif cgi_key in cgi_names:
1.26 + header_name = cgi_key.replace("_", "-").lower()
1.27 + headers[header_name] = value
1.28
1.29 return headers
1.30