fix(scaleway): use jsonify for application/json content-type only (#66957)
* fix(scaleway): use jsonify for application/json content-type * add changelog
This commit is contained in:
parent
600d6278f9
commit
f70dc261cc
2 changed files with 5 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- 'scaleway: use jsonify unmarshaller only for application/json requests to avoid breaking the multiline configuration with requests in text/plain (https://github.com/ansible/ansible/issues/65036)'
|
|
@ -118,11 +118,13 @@ class Scaleway(object):
|
|||
def send(self, method, path, data=None, headers=None, params=None):
|
||||
url = self._url_builder(path=path, params=params)
|
||||
self.warn(url)
|
||||
data = self.module.jsonify(data)
|
||||
|
||||
if headers is not None:
|
||||
self.headers.update(headers)
|
||||
|
||||
if self.headers['Content-Type'] == "application/json":
|
||||
data = self.module.jsonify(data)
|
||||
|
||||
resp, info = fetch_url(
|
||||
self.module, url, data=data, headers=self.headers, method=method,
|
||||
timeout=self.module.params.get('api_timeout')
|
||||
|
|
Loading…
Reference in a new issue