##// END OF EJS Templates
hgweb: use native strings when interfacing with stdlib headers...
Augie Fackler -
r37609:b5ca5d34 default
parent child Browse files
Show More
@@ -139,17 +139,17 b' class _httprequesthandler(httpservermod.'
139 env[r'CONTENT_TYPE'] = self.headers.get_default_type()
139 env[r'CONTENT_TYPE'] = self.headers.get_default_type()
140 else:
140 else:
141 env[r'CONTENT_TYPE'] = self.headers.get_content_type()
141 env[r'CONTENT_TYPE'] = self.headers.get_content_type()
142 length = self.headers.get('content-length')
142 length = self.headers.get(r'content-length')
143 else:
143 else:
144 if self.headers.typeheader is None:
144 if self.headers.typeheader is None:
145 env[r'CONTENT_TYPE'] = self.headers.type
145 env[r'CONTENT_TYPE'] = self.headers.type
146 else:
146 else:
147 env[r'CONTENT_TYPE'] = self.headers.typeheader
147 env[r'CONTENT_TYPE'] = self.headers.typeheader
148 length = self.headers.getheader('content-length')
148 length = self.headers.getheader(r'content-length')
149 if length:
149 if length:
150 env[r'CONTENT_LENGTH'] = length
150 env[r'CONTENT_LENGTH'] = length
151 for header in [h for h in self.headers.keys()
151 for header in [h for h in self.headers.keys()
152 if h not in ('content-type', 'content-length')]:
152 if h not in (r'content-type', r'content-length')]:
153 hkey = r'HTTP_' + header.replace(r'-', r'_').upper()
153 hkey = r'HTTP_' + header.replace(r'-', r'_').upper()
154 hval = self.headers.get(header)
154 hval = self.headers.get(header)
155 hval = hval.replace(r'\n', r'').strip()
155 hval = hval.replace(r'\n', r'').strip()
General Comments 0
You need to be logged in to leave comments. Login now