##// 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 class httprepository(wireproto.wirerepos
128 128 try:
129 129 proto = resp.getheader('content-type')
130 130 except AttributeError:
131 proto = resp.headers['content-type']
131 proto = resp.headers.get('content-type', '')
132 132
133 133 safeurl = util.hidepassword(self._url)
134 134 # accept old "text/plain" and "application/hg-changegroup" for now
@@ -139,7 +139,7 class httprepository(wireproto.wirerepos
139 139 raise error.RepoError(
140 140 _("'%s' does not appear to be an hg repository:\n"
141 141 "---%%<--- (%s)\n%s\n---%%<---\n")
142 % (safeurl, proto, resp.read()))
142 % (safeurl, proto or 'no content-type', resp.read()))
143 143
144 144 if proto.startswith('application/mercurial-'):
145 145 try:
General Comments 0
You need to be logged in to leave comments. Login now