Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions kubernetes/client/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ def __init__(self, resp):

def getheaders(self):
"""Returns a dictionary of the response headers."""
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring states "Returns a dictionary of the response headers" but the method returns headers.items() which returns an iterable of tuples (key-value pairs), not a dictionary. Consider updating the docstring to accurately reflect the return type, such as "Returns an iterable of header key-value pairs" or "Returns header items as tuples".

Suggested change
"""Returns a dictionary of the response headers."""
"""Returns an iterable of header key-value pairs (tuples)."""

Copilot uses AI. Check for mistakes.
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)


Expand Down