Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/server.py @ 48997:e453c69821f8
hgweb: remove Python 2 support code
Differential Revision: https://phab.mercurial-scm.org/D12309
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 21 Feb 2022 10:47:08 -0700 |
parents | 6000f5b25c9b |
children | 642e31cb55f0 |
comparison
equal
deleted
inserted
replaced
48996:7eebe5630bcc | 48997:e453c69821f8 |
---|---|
183 env['PATH_INFO'] = pycompat.sysstr(path[len(self.server.prefix) :]) | 183 env['PATH_INFO'] = pycompat.sysstr(path[len(self.server.prefix) :]) |
184 env['REMOTE_HOST'] = self.client_address[0] | 184 env['REMOTE_HOST'] = self.client_address[0] |
185 env['REMOTE_ADDR'] = self.client_address[0] | 185 env['REMOTE_ADDR'] = self.client_address[0] |
186 env['QUERY_STRING'] = query or '' | 186 env['QUERY_STRING'] = query or '' |
187 | 187 |
188 if pycompat.ispy3: | 188 if self.headers.get_content_type() is None: |
189 if self.headers.get_content_type() is None: | 189 env['CONTENT_TYPE'] = self.headers.get_default_type() |
190 env['CONTENT_TYPE'] = self.headers.get_default_type() | |
191 else: | |
192 env['CONTENT_TYPE'] = self.headers.get_content_type() | |
193 length = self.headers.get('content-length') | |
194 else: | 190 else: |
195 if self.headers.typeheader is None: | 191 env['CONTENT_TYPE'] = self.headers.get_content_type() |
196 env['CONTENT_TYPE'] = self.headers.type | 192 length = self.headers.get('content-length') |
197 else: | |
198 env['CONTENT_TYPE'] = self.headers.typeheader | |
199 length = self.headers.getheader('content-length') | |
200 if length: | 193 if length: |
201 env['CONTENT_LENGTH'] = length | 194 env['CONTENT_LENGTH'] = length |
202 for header in [ | 195 for header in [ |
203 h | 196 h |
204 for h in self.headers.keys() | 197 for h in self.headers.keys() |