##// END OF EJS Templates
fix handling of multiple Content-type headers...
Benoit Boissinot -
r4012:d1e31d7f default
parent child Browse files
Show More
@@ -257,15 +257,19 b' class httprepository(remoterepository):'
257 proto = resp.headers['content-type']
257 proto = resp.headers['content-type']
258
258
259 # accept old "text/plain" and "application/hg-changegroup" for now
259 # accept old "text/plain" and "application/hg-changegroup" for now
260 if not proto.startswith('application/mercurial') and \
260 if not proto.startswith('application/mercurial-') and \
261 not proto.startswith('text/plain') and \
261 not proto.startswith('text/plain') and \
262 not proto.startswith('application/hg-changegroup'):
262 not proto.startswith('application/hg-changegroup'):
263 raise hg.RepoError(_("'%s' does not appear to be an hg repository") %
263 raise hg.RepoError(_("'%s' does not appear to be an hg repository") %
264 self._url)
264 self._url)
265
265
266 if proto.startswith('application/mercurial'):
266 if proto.startswith('application/mercurial-'):
267 version = proto[22:]
267 try:
268 if float(version) > 0.1:
268 version = float(proto[22:])
269 except ValueError:
270 raise hg.RepoError(_("'%s' sent a broken Content-type "
271 "header (%s)") % (self._url, proto))
272 if version > 0.1:
269 raise hg.RepoError(_("'%s' uses newer protocol %s") %
273 raise hg.RepoError(_("'%s' uses newer protocol %s") %
270 (self._url, version))
274 (self._url, version))
271
275
General Comments 0
You need to be logged in to leave comments. Login now