fix: Don't post data if no arguments were passed.#85
Merged
rbeuque74 merged 2 commits intoovh:masterfrom Mar 14, 2022
Merged
Conversation
|
Any news about this issues ? |
|
Hello, |
rbeuque74
reviewed
Jun 24, 2021
|
Hello, Any news on this issue ? Regards |
sdiemer
added a commit
to UbiCastTeam/python-ovh
that referenced
this pull request
Jan 24, 2022
7eb9aca to
74f23e1
Compare
There have been some changes in the production API that make any POST call without arguments to fail with the following error:
`You provided an input body while none was expected`
This is in particular the case in the `cloud/project/{}/kube/{}/kubeconfig` call.
The `kwargs` arguments to the upstream call is passed as `data` to `raw_call()`. A check for `None` is done to prevent adding a body. This condition is never true as in the case of no arguments, `data` is not `None` but contains an empty dict. In this case, loosy testing for _falsiness_ is better.
74f23e1 to
5cfac4b
Compare
…ovided Signed-off-by: Romain Beuque <556072+rbeuque74@users.noreply.github.com>
cae3541 to
2b1cde9
Compare
Member
|
Hello @sdiemer , Thanks for your contribution ! 💯 |
This was referenced Mar 15, 2022
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There have been some changes in the production API that make any POST call without arguments to fail with the following error:
You provided an input body while none was expectedThis is in particular the case in the
cloud/project/{}/kube/{}/kubeconfigcall.The
kwargsarguments to the upstream call is passed asdatatoraw_call(). A check forNoneis done to prevent adding a body. This condition is never true as in the case of no arguments,datais notNonebut contains an empty dict. In this case, loosy testing for falsiness is better.