diff options
author | Rabi Mishra <ramishra@redhat.com> | 2019-03-14 20:27:25 +0530 |
---|---|---|
committer | Rabi Mishra <ramishra@redhat.com> | 2019-03-15 05:08:51 +0000 |
commit | bd33e310e09339a21097c66d4022538f6bcbad2f (patch) | |
tree | 8abcab58ba228b406185d2f5b875149389e827b6 /heatclient/common | |
parent | 8af5deb458d51f4ec16e769d7fd6c94655f82f5f (diff) | |
download | python-heatclient-bd33e310e09339a21097c66d4022538f6bcbad2f.tar.gz |
Set Content-Type header explictly for SessionClient
SessionClient is subclassed from keystoneauth LegacyJsonAdapter.
LegacyJsonAdapter does not set the Content-Type explicitly
and results in decodeing issues in some cases.
Change-Id: Idf23022b394607c332490331fc4b216de6ff1313
Story: 2005237
Task: 30027
Diffstat (limited to 'heatclient/common')
-rw-r--r-- | heatclient/common/http.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/heatclient/common/http.py b/heatclient/common/http.py index 0894e19..1f86c24 100644 --- a/heatclient/common/http.py +++ b/heatclient/common/http.py @@ -308,6 +308,9 @@ class SessionClient(adapter.LegacyJsonAdapter): redirect = kwargs.get('redirect') kwargs.setdefault('user_agent', USER_AGENT) + headers = kwargs.setdefault('headers', {}) + headers.setdefault('Content-Type', 'application/json') + if 'data' in kwargs: kwargs['data'] = jsonutils.dumps(kwargs['data']) |