Remove glance.common.client._encode_headers

This is no longer necessary now that everything is a unicode string.

Change-Id: I809d9ba93ed19a8dd7a7be59e5470c56aca871e7
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
Stephen Finucane 2022-01-27 16:32:23 +00:00
parent 33741138d9
commit 87b4b33e86

View File

@ -399,19 +399,6 @@ class BaseClient(object):
LOG.debug(log_msg, url.geturl())
return url
def _encode_headers(self, headers):
"""
Encodes headers.
Note: This should be used right before
sending anything out.
:param headers: Headers to encode
:returns: Dictionary with encoded headers'
names and values
"""
return {str(h): str(v) for h, v in headers.items()}
@handle_redirects
def _do_request(self, method, url, body, headers):
"""
@ -442,7 +429,7 @@ class BaseClient(object):
try:
connection_type = self.get_connection_type()
headers = self._encode_headers(headers or {})
headers = headers or {}
headers.update(osprofiler.web.get_trace_id_headers())
if 'x-auth-token' not in headers and self.auth_token: