Skip to content

Commit 70fa8ed

Browse files
authored
Merge pull request #179 from Keisim/m2_fix_headers_parameter
Fix propagating headers across different class instances
2 parents 79a008d + fd55e5e commit 70fa8ed

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/redfish/rest/v1.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ def _rest_request(self, path, method='GET', args=None, body=None,
986986
else:
987987
raise RetriesExhaustedError() from cause_exception
988988

989-
def login(self, username=None, password=None, auth=AuthMethod.SESSION, headers={}):
989+
def login(self, username=None, password=None, auth=AuthMethod.SESSION, headers=None):
990990
"""Login and start a REST session. Remember to call logout() when"""
991991
""" you are done.
992992
@@ -1006,6 +1006,8 @@ def login(self, username=None, password=None, auth=AuthMethod.SESSION, headers={
10061006
self.__username = username if username else self.__username
10071007
self.__password = password if password else self.__password
10081008

1009+
headers = headers if headers else {}
1010+
10091011
if auth == AuthMethod.BASIC:
10101012
auth_key = base64.b64encode(('%s:%s' % (self.__username,
10111013
self.__password)).encode('utf-8')).decode('utf-8')

0 commit comments

Comments
 (0)