mercurial/httppeer.py
changeset 34725 a288712d86d5
parent 34724 9c3dcaf648ef
child 34732 67e9678efd98
equal deleted inserted replaced
34724:9c3dcaf648ef 34725:a288712d86d5
   309         if self._url.rstrip('/') != resp_url.rstrip('/'):
   309         if self._url.rstrip('/') != resp_url.rstrip('/'):
   310             if not self.ui.quiet:
   310             if not self.ui.quiet:
   311                 self.ui.warn(_('real URL is %s\n') % resp_url)
   311                 self.ui.warn(_('real URL is %s\n') % resp_url)
   312         self._url = resp_url
   312         self._url = resp_url
   313         try:
   313         try:
   314             proto = resp.getheader('content-type')
   314             proto = pycompat.bytesurl(resp.getheader(r'content-type', r''))
   315         except AttributeError:
   315         except AttributeError:
   316             proto = resp.headers.get('content-type', '')
   316             proto = pycompat.bytesurl(resp.headers.get(r'content-type', r''))
   317 
   317 
   318         safeurl = util.hidepassword(self._url)
   318         safeurl = util.hidepassword(self._url)
   319         if proto.startswith('application/hg-error'):
   319         if proto.startswith('application/hg-error'):
   320             raise error.OutOfBandError(resp.read())
   320             raise error.OutOfBandError(resp.read())
   321         # accept old "text/plain" and "application/hg-changegroup" for now
   321         # accept old "text/plain" and "application/hg-changegroup" for now