Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/wsgicgi.py @ 18552:e8efcc8ff5c0 stable
hgweb.cgi: fix internal WSGI emulation (issue3804)
The internal WSGI emulation in wsgicgi.py was not fully WSGI compliant and
assumed that all responses sent a body. With 3fbdbeab38cc that caused a real
bug when using hgweb.cgi.
wsgicgi.py will now make sure headers always are sent, using the pattern from
PEP 333 and similar to how it is done in c007e5c54b16.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Mon, 04 Feb 2013 23:25:25 +0100 |
parents | e7cfe3587ea4 |
children | 37fcfe52c68c |
line wrap: on
line diff
--- a/mercurial/hgweb/wsgicgi.py Sun Feb 03 14:26:39 2013 -0800 +++ b/mercurial/hgweb/wsgicgi.py Mon Feb 04 23:25:25 2013 +0100 @@ -77,5 +77,7 @@ try: for chunk in content: write(chunk) + if not headers_sent: + write('') # send headers now if body was empty finally: getattr(content, 'close', lambda : None)()