diff --git a/kubernetes/client/rest.py b/kubernetes/client/rest.py index bb97dfe3c7..b9057fbdd9 100644 --- a/kubernetes/client/rest.py +++ b/kubernetes/client/rest.py @@ -41,10 +41,14 @@ def __init__(self, resp): def getheaders(self): """Returns a dictionary of the response headers.""" + if hasattr(self.urllib3_response, 'headers'): + return self.urllib3_response.headers return self.urllib3_response.getheaders() def getheader(self, name, default=None): """Returns a given response header.""" + if hasattr(self.urllib3_response, 'headers'): + return self.urllib3_response.headers.get(name, default) return self.urllib3_response.getheader(name, default)