From 87b4b33e861747154087a62df32cc440e40021a4 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 27 Jan 2022 16:32:23 +0000 Subject: [PATCH] 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 --- glance/common/client.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/glance/common/client.py b/glance/common/client.py index 2de1618813..5ebdeee33e 100644 --- a/glance/common/client.py +++ b/glance/common/client.py @@ -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: