# HG changeset patch # User Pierre-Yves.David@ens-lyon.org # Date 2012-07-13 11:21:20 # Node ID 988974c2a4bf3aa18dcfb8a094b87d23aefb5542 # Parent bdac214a47055ef8c99f0a65e2ca3c030229d727 httprepo: ensure Content-Type header exists when pushing data Otherwise the wireprotocol just hangs while trying to send data. (And nothing is received at the other side) diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py --- a/mercurial/httppeer.py +++ b/mercurial/httppeer.py @@ -79,6 +79,9 @@ class httppeer(wireproto.wirepeer): elif data is not None: size = len(data) headers = args.pop('headers', {}) + if data is not None and 'Content-Type' not in headers: + headers['Content-Type'] = 'application/mercurial-0.1' + if size and self.ui.configbool('ui', 'usehttp2', False): headers['Expect'] = '100-Continue'