mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
httprepo: proper handling of invalid responses without content-type (issue2019)
This can currently be tested on http://sf.net/
This commit is contained in:
parent
e24ddf937d
commit
aec14e75e6
@ -128,7 +128,7 @@ class httprepository(wireproto.wirerepository):
|
||||
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 @@ class httprepository(wireproto.wirerepository):
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user