Ignore NoneType when encoding headers
Some generated header values may in fact be None. Trying to encode None causes the client to fail with an exception and cannot be worked around by the user. Change-Id: I638b1fba0ef9a07d726445d8c2cdd774140f5b83 Closes-bug: 1415935
This commit is contained in:
@@ -147,7 +147,7 @@ class HTTPClient(object):
|
||||
names and values
|
||||
"""
|
||||
return dict((encodeutils.safe_encode(h), encodeutils.safe_encode(v))
|
||||
for h, v in six.iteritems(headers))
|
||||
for h, v in six.iteritems(headers) if v is not None)
|
||||
|
||||
def _request(self, method, url, **kwargs):
|
||||
"""Send an http request with the specified characteristics.
|
||||
|
||||
Reference in New Issue
Block a user