2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-27 19:37:44 +00:00

Fix the custom cookies feature

As written, it broke non-custom case.

Change-Id: I2a533207f060c3d06ee8fc0826d6a8d7f1ec39c1
This commit is contained in:
Jarrod Johnson 2018-01-04 16:58:35 -05:00
parent 2d47854631
commit bf15d7f382

View File

@ -169,7 +169,7 @@ class SecureHTTPConnection(httplib.HTTPConnection, object):
for ckey in self.cookies:
cookies.append('{0}={1}'.format(ckey, self.cookies[ckey]))
cookies_header = '; '.join(cookies)
if headers['Cookie'] is None:
if headers.get('Cookie', None) is None:
headers['Cookie'] = cookies_header
else:
headers['Cookie'] += '; ' + '; '.join(cookies)