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

scaleway: Fix case mismatch causing key lookup failure (#445)

The common http api client class used by the scaleway modules only
enables automatic jsonification of the request body if the
"Content-Type" header is application/json. The client only included
"Content-type" in its default set of headers (notice the case
variation).

This caused a KeyError on send() if the caller relied on the default
content-type value.
This commit is contained in:
Olof Johansson 2020-06-02 15:09:58 +02:00 committed by GitHub
parent c2bf9ea9fb
commit 1a0a185ac3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- scaleway - Fix bug causing KeyError exception on JSON http requests. (https://github.com/ansible-collections/community.general/pull/444)

View file

@ -90,7 +90,7 @@ class Scaleway(object):
self.headers = { self.headers = {
'X-Auth-Token': self.module.params.get('api_token'), 'X-Auth-Token': self.module.params.get('api_token'),
'User-Agent': self.get_user_agent_string(module), 'User-Agent': self.get_user_agent_string(module),
'Content-type': 'application/json', 'Content-Type': 'application/json',
} }
self.name = None self.name = None