##// 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 b' class httprepository(wireproto.wirerepos'
107 try:
107 try:
108 proto = resp.getheader('content-type')
108 proto = resp.getheader('content-type')
109 except AttributeError:
109 except AttributeError:
110 proto = resp.headers['content-type']
110 proto = resp.headers.get('content-type', '')
111
111
112 safeurl = url.hidepassword(self._url)
112 safeurl = url.hidepassword(self._url)
113 # accept old "text/plain" and "application/hg-changegroup" for now
113 # accept old "text/plain" and "application/hg-changegroup" for now
@@ -118,7 +118,7 b' class httprepository(wireproto.wirerepos'
118 raise error.RepoError(
118 raise error.RepoError(
119 _("'%s' does not appear to be an hg repository:\n"
119 _("'%s' does not appear to be an hg repository:\n"
120 "---%%<--- (%s)\n%s\n---%%<---\n")
120 "---%%<--- (%s)\n%s\n---%%<---\n")
121 % (safeurl, proto, resp.read()))
121 % (safeurl, proto or 'no content-type', resp.read()))
122
122
123 if proto.startswith('application/mercurial-'):
123 if proto.startswith('application/mercurial-'):
124 try:
124 try:
General Comments 0
You need to be logged in to leave comments. Login now