##// END OF EJS Templates
httprepo: proper handling of invalid responses without content-type (issue2019)...
Mads Kiilerich -
r14149:091c86a7 default
parent child Browse files
Show More
@@ -128,7 +128,7 b' class httprepository(wireproto.wirerepos'
128 try:
128 try:
129 proto = resp.getheader('content-type')
129 proto = resp.getheader('content-type')
130 except AttributeError:
130 except AttributeError:
131 proto = resp.headers['content-type']
131 proto = resp.headers.get('content-type', '')
132
132
133 safeurl = util.hidepassword(self._url)
133 safeurl = util.hidepassword(self._url)
134 # accept old "text/plain" and "application/hg-changegroup" for now
134 # accept old "text/plain" and "application/hg-changegroup" for now
@@ -139,7 +139,7 b' class httprepository(wireproto.wirerepos'
139 raise error.RepoError(
139 raise error.RepoError(
140 _("'%s' does not appear to be an hg repository:\n"
140 _("'%s' does not appear to be an hg repository:\n"
141 "---%%<--- (%s)\n%s\n---%%<---\n")
141 "---%%<--- (%s)\n%s\n---%%<---\n")
142 % (safeurl, proto, resp.read()))
142 % (safeurl, proto or 'no content-type', resp.read()))
143
143
144 if proto.startswith('application/mercurial-'):
144 if proto.startswith('application/mercurial-'):
145 try:
145 try:
General Comments 0
You need to be logged in to leave comments. Login now