Skip to content

Commit

Permalink
improve bug fix of content-type in case of bad authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienDucourthial committed May 27, 2024
1 parent 9e76806 commit 9f255df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/module_utils/horizon.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def send(self, method, path, **kwargs):
except requests.exceptions.SSLError:
raise AnsibleError("Got an SSL error try using the 'ca_bundle' paramater")

if ('Content-Type' in response.headers and response.headers['Content-Type'] == 'application/json') or response.status_code >= 400:
if 'Content-Type' in response.headers and response.headers['Content-Type'] in ['application/json', 'application/problem+json']:
content = response.json()
else:
content = response.content.decode()
Expand Down

0 comments on commit 9f255df

Please sign in to comment.