Fix default value for a header

This code specified None as the default value, but it would raise an
exception if that was ever returned.  An empty string causes the code to
work as intended.

This came up while I was writing a unit test for another bug fix.

Change-Id: I658bb8a9b5124f281988fb60b645182ea0ccf99f
Related-bug: #1231524
This commit is contained in:
Russell Bryant 2013-09-26 11:42:16 -04:00
parent 7a4a8a0979
commit 4718635811

@ -248,7 +248,7 @@ class HTTPClient(object):
resp, body_iter = self._http_request(url, method, **kwargs)
if 'application/json' in resp.getheader('content-type', None):
if 'application/json' in resp.getheader('content-type', ''):
body = ''.join([chunk for chunk in body_iter])
try:
body = json.loads(body)