Patchwork D2849: hgweb: also set Content-Type header

login
register
mail settings
Submitter phabricator
Date March 19, 2018, 11:59 p.m.
Message ID <16b3f9e7c1c8cf0ab1b73ff370ea5b81@localhost.localdomain>
Download mbox | patch
Permalink /patch/29647/
State Not Applicable
Headers show

Comments

phabricator - March 19, 2018, 11:59 p.m.
indygreg updated this revision to Diff 7137.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2849?vs=7012&id=7137

REVISION DETAIL
  https://phab.mercurial-scm.org/D2849

AFFECTED FILES
  mercurial/hgweb/request.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/hgweb/request.py b/mercurial/hgweb/request.py
--- a/mercurial/hgweb/request.py
+++ b/mercurial/hgweb/request.py
@@ -325,6 +325,9 @@ 
     if 'CONTENT_LENGTH' in env and 'HTTP_CONTENT_LENGTH' not in env:
         headers['Content-Length'] = env['CONTENT_LENGTH']
 
+    if 'CONTENT_TYPE' in env and 'HTTP_CONTENT_TYPE' not in env:
+        headers['Content-Type'] = env['CONTENT_TYPE']
+
     bodyfh = env['wsgi.input']
     if 'Content-Length' in headers:
         bodyfh = util.cappedreader(bodyfh, int(headers['Content-Length']))