mirror of
https://github.com/ceph/ceph
synced 2025-02-21 09:57:26 +00:00
Merge pull request #24350 from ricardoasmarques/wip-json-decode
mgr/dashboard: Check content-type before decode json response Reviewed-by: Lenz Grimmer <lgrimmer@suse.com> Reviewed-by: Ricardo Dias <rdias@suse.com>
This commit is contained in:
commit
43a72f0e49
@ -169,7 +169,8 @@ class DashboardTestCase(MgrTestCase):
|
||||
else:
|
||||
assert False
|
||||
try:
|
||||
if cls._resp.text and cls._resp.text != "":
|
||||
content_type = cls._resp.headers['content-type']
|
||||
if content_type == 'application/json' and cls._resp.text and cls._resp.text != "":
|
||||
return cls._resp.json()
|
||||
return cls._resp.text
|
||||
except ValueError as ex:
|
||||
|
Loading…
Reference in New Issue
Block a user