summaryrefslogtreecommitdiff
path: root/heatclient/common/http.py
diff options
context:
space:
mode:
authorRabi Mishra <ramishra@redhat.com>2019-03-14 20:27:25 +0530
committerPavlo Shchelokovskyy <pshchelokovskyy@mirantis.com>2019-06-03 09:21:18 +0000
commit39cda16fb0ccdc8f919f99cbc92593c7535d9142 (patch)
tree870cf9cf2569e4a3793a52dab8ecfd4ebb2e4579 /heatclient/common/http.py
parent37a531fe857026363e0168aab831472871d2a9e4 (diff)
downloadpython-heatclient-stable/stein.tar.gz
Set Content-Type header explictly for SessionClientstein-eolstein-em1.17.1stable/stein
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 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'])