Skip to content
Snippets Groups Projects
Commit 091c86a7 authored by kiilerix's avatar kiilerix
Browse files

httprepo: proper handling of invalid responses without content-type (issue2019)

This can currently be tested on http://sf.net/
parent cc9366a3
No related branches found
No related tags found
No related merge requests found
......@@ -128,7 +128,7 @@
try:
proto = resp.getheader('content-type')
except AttributeError:
proto = resp.headers['content-type']
proto = resp.headers.get('content-type', '')
safeurl = util.hidepassword(self._url)
# accept old "text/plain" and "application/hg-changegroup" for now
......@@ -139,7 +139,7 @@
raise error.RepoError(
_("'%s' does not appear to be an hg repository:\n"
"---%%<--- (%s)\n%s\n---%%<---\n")
% (safeurl, proto, resp.read()))
% (safeurl, proto or 'no content-type', resp.read()))
if proto.startswith('application/mercurial-'):
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment