summaryrefslogtreecommitdiff
path: root/heatclient/common/http.py
diff options
context:
space:
mode:
authorRabi Mishra <ramishra@redhat.com>2019-03-14 20:27:25 +0530
committerRabi Mishra <ramishra@redhat.com>2019-03-18 05:28:26 +0000
commit034e6dd56ca5b92bb09e2330ab2a3e9d95650383 (patch)
treea505530f54c42a126bb3fb8b505161ca3a0e47aa /heatclient/common/http.py
parent2557c3985487c74681a4fdb1f6a9f8811f4ab60c (diff)
downloadpython-heatclient-queens-em.tar.gz
Set Content-Type header explictly for SessionClientqueens-em1.14.1
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 (cherry picked from commit bd33e310e09339a21097c66d4022538f6bcbad2f)
Diffstat (limited to 'heatclient/common/http.py')
-rw-r--r--heatclient/common/http.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/heatclient/common/http.py b/heatclient/common/http.py
index 4b765df..a51041d 100644
--- a/heatclient/common/http.py
+++ b/heatclient/common/http.py
@@ -305,6 +305,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'])