1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Add text/json as a mimetype to try deserializing

Fixes #503
This commit is contained in:
Toshio Kuratomi 2014-12-16 13:54:23 -08:00 committed by Matt Clay
parent 8c05023be3
commit 104b2d684c

View file

@ -426,7 +426,8 @@ def main():
uresp[ukey] = value uresp[ukey] = value
if 'content_type' in uresp: if 'content_type' in uresp:
if uresp['content_type'].startswith('application/json'): if uresp['content_type'].startswith('application/json') or \
uresp['content_type'].startswith('text/json'):
try: try:
js = json.loads(content) js = json.loads(content)
uresp['json'] = js uresp['json'] = js