# HG changeset patch # User Augie Fackler # Date 1507229632 14400 # Node ID 6e1b05692b2cd4e1b7979c5aed20762a3374cfe0 # Parent 01206460897a63ad2ede05b39e92895ab7b28d0a hgweb: detect Python 3-era libraries and use modern attribute names Differential Revision: https://phab.mercurial-scm.org/D1084 diff -r 01206460897a -r 6e1b05692b2c mercurial/hgweb/server.py --- a/mercurial/hgweb/server.py Sat Oct 14 15:53:36 2017 -0400 +++ b/mercurial/hgweb/server.py Thu Oct 05 14:53:52 2017 -0400 @@ -130,7 +130,13 @@ if query: env[r'QUERY_STRING'] = query - if True: + if pycompat.ispy3: + if self.headers.get_content_type() is None: + env[r'CONTENT_TYPE'] = self.headers.get_default_type() + else: + env[r'CONTENT_TYPE'] = self.headers.get_content_type() + length = self.headers.get('content-length') + else: if self.headers.typeheader is None: env[r'CONTENT_TYPE'] = self.headers.type else: