changeset 17221:988974c2a4bf

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)
author Pierre-Yves.David@ens-lyon.org
date Fri, 13 Jul 2012 13:21:20 +0200
parents bdac214a4705
children 23b247234454
files mercurial/httppeer.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/httppeer.py	Fri Jul 13 22:15:11 2012 +0200
+++ b/mercurial/httppeer.py	Fri Jul 13 13:21:20 2012 +0200
@@ -79,6 +79,9 @@
         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'