##// END OF EJS Templates
hide passwords in httprepo error messages
Steve Borho -
r8053:97617006 default
parent child Browse files
Show More
@@ -99,13 +99,14 class httprepository(repo.repository):
99 except AttributeError:
99 except AttributeError:
100 proto = resp.headers['content-type']
100 proto = resp.headers['content-type']
101
101
102 safeurl = url.hidepassword(self._url)
102 # accept old "text/plain" and "application/hg-changegroup" for now
103 # accept old "text/plain" and "application/hg-changegroup" for now
103 if not (proto.startswith('application/mercurial-') or
104 if not (proto.startswith('application/mercurial-') or
104 proto.startswith('text/plain') or
105 proto.startswith('text/plain') or
105 proto.startswith('application/hg-changegroup')):
106 proto.startswith('application/hg-changegroup')):
106 self.ui.debug(_("Requested URL: '%s'\n") % cu)
107 self.ui.debug(_("Requested URL: '%s'\n") % cu)
107 raise error.RepoError(_("'%s' does not appear to be an hg repository")
108 raise error.RepoError(_("'%s' does not appear to be an hg repository")
108 % self._url)
109 % safeurl)
109
110
110 if proto.startswith('application/mercurial-'):
111 if proto.startswith('application/mercurial-'):
111 try:
112 try:
@@ -113,10 +114,10 class httprepository(repo.repository):
113 version_info = tuple([int(n) for n in version.split('.')])
114 version_info = tuple([int(n) for n in version.split('.')])
114 except ValueError:
115 except ValueError:
115 raise error.RepoError(_("'%s' sent a broken Content-Type "
116 raise error.RepoError(_("'%s' sent a broken Content-Type "
116 "header (%s)") % (self._url, proto))
117 "header (%s)") % (safeurl, proto))
117 if version_info > (0, 1):
118 if version_info > (0, 1):
118 raise error.RepoError(_("'%s' uses newer protocol %s") %
119 raise error.RepoError(_("'%s' uses newer protocol %s") %
119 (self._url, version))
120 (safeurl, version))
120
121
121 return resp
122 return resp
122
123
General Comments 0
You need to be logged in to leave comments. Login now