Details
Details
- Reviewers
Alphare - Group Reviewers
hg-reviewers - Commits
- rHGe453c69821f8: hgweb: remove Python 2 support code
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
( )
Alphare |
hg-reviewers |
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/hgweb/server.py (15 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
b2576ebf63e7 | ecd400b6baf1 | Gregory Szorc | Feb 21 2022, 12:47 PM |
env['SERVER_PORT'] = str(self.server.server_port) | env['SERVER_PORT'] = str(self.server.server_port) | ||||
env['REQUEST_URI'] = self.path | env['REQUEST_URI'] = self.path | ||||
env['SCRIPT_NAME'] = pycompat.sysstr(self.server.prefix) | env['SCRIPT_NAME'] = pycompat.sysstr(self.server.prefix) | ||||
env['PATH_INFO'] = pycompat.sysstr(path[len(self.server.prefix) :]) | env['PATH_INFO'] = pycompat.sysstr(path[len(self.server.prefix) :]) | ||||
env['REMOTE_HOST'] = self.client_address[0] | env['REMOTE_HOST'] = self.client_address[0] | ||||
env['REMOTE_ADDR'] = self.client_address[0] | env['REMOTE_ADDR'] = self.client_address[0] | ||||
env['QUERY_STRING'] = query or '' | env['QUERY_STRING'] = query or '' | ||||
if pycompat.ispy3: | |||||
if self.headers.get_content_type() is None: | if self.headers.get_content_type() is None: | ||||
env['CONTENT_TYPE'] = self.headers.get_default_type() | env['CONTENT_TYPE'] = self.headers.get_default_type() | ||||
else: | else: | ||||
env['CONTENT_TYPE'] = self.headers.get_content_type() | env['CONTENT_TYPE'] = self.headers.get_content_type() | ||||
length = self.headers.get('content-length') | length = self.headers.get('content-length') | ||||
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') | |||||
if length: | if length: | ||||
env['CONTENT_LENGTH'] = length | env['CONTENT_LENGTH'] = length | ||||
for header in [ | for header in [ | ||||
h | h | ||||
for h in self.headers.keys() | for h in self.headers.keys() | ||||
if h.lower() not in ('content-type', 'content-length') | if h.lower() not in ('content-type', 'content-length') | ||||
]: | ]: | ||||
hkey = 'HTTP_' + header.replace('-', '_').upper() | hkey = 'HTTP_' + header.replace('-', '_').upper() |