hgweb: remove Python 2 support code
Differential Revision: https://phab.mercurial-scm.org/D12309
--- a/mercurial/hgweb/server.py Thu Mar 03 08:06:37 2022 -0800
+++ b/mercurial/hgweb/server.py Mon Feb 21 10:47:08 2022 -0700
@@ -185,18 +185,11 @@
env['REMOTE_ADDR'] = self.client_address[0]
env['QUERY_STRING'] = query or ''
- if pycompat.ispy3:
- if self.headers.get_content_type() is None:
- env['CONTENT_TYPE'] = self.headers.get_default_type()
- else:
- env['CONTENT_TYPE'] = self.headers.get_content_type()
- length = self.headers.get('content-length')
+ if self.headers.get_content_type() is None:
+ env['CONTENT_TYPE'] = self.headers.get_default_type()
else:
- if self.headers.typeheader is None:
- env['CONTENT_TYPE'] = self.headers.type
- else:
- env['CONTENT_TYPE'] = self.headers.typeheader
- length = self.headers.getheader('content-length')
+ env['CONTENT_TYPE'] = self.headers.get_content_type()
+ length = self.headers.get('content-length')
if length:
env['CONTENT_LENGTH'] = length
for header in [