2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-14 03:37:47 +00:00

Merge "Fix the custom cookies feature"

This commit is contained in:
Zuul 2018-01-04 23:53:35 +00:00 committed by Gerrit Code Review
commit d33aeb321c

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)