##// END OF EJS Templates
httprepo: proper handling of invalid responses without content-type (issue2019)...
Mads Kiilerich -
r14503:4e958f2a stable
parent child Browse files
Show More
@@ -107,7 +107,7 class httprepository(wireproto.wirerepos
107 107 try:
108 108 proto = resp.getheader('content-type')
109 109 except AttributeError:
110 proto = resp.headers['content-type']
110 proto = resp.headers.get('content-type', '')
111 111
112 112 safeurl = url.hidepassword(self._url)
113 113 # accept old "text/plain" and "application/hg-changegroup" for now
@@ -118,7 +118,7 class httprepository(wireproto.wirerepos
118 118 raise error.RepoError(
119 119 _("'%s' does not appear to be an hg repository:\n"
120 120 "---%%<--- (%s)\n%s\n---%%<---\n")
121 % (safeurl, proto, resp.read()))
121 % (safeurl, proto or 'no content-type', resp.read()))
122 122
123 123 if proto.startswith('application/mercurial-'):
124 124 try:
General Comments 0
You need to be logged in to leave comments. Login now