changeset 48906: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 7eebe5630bcc
children b677bccf74b9
files mercurial/hgweb/server.py
diffstat 1 files changed, 4 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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 [