Skip to content

Commit

Permalink
Fix params passing in Docker API calls (#543)
Browse files Browse the repository at this point in the history
* Use 'json.dumps' instead of 'str' in 'utils.httpize'

Fixes passing JSON structures as params.

* Finish checklist
  • Loading branch information
yannickperrenet committed Jul 21, 2021
1 parent e2ed71d commit 8b3c578
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/543.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix passing of JSON params.
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ Paul Tagliamonte
Tianon Gravi
Tommy Beadle
Travis DePrato
Yannick Perrenet
2 changes: 1 addition & 1 deletion aiodocker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def httpize(d: Optional[Mapping]) -> Optional[Mapping[str, Any]]:
if isinstance(v, bool):
v = "1" if v else "0"
if not isinstance(v, str):
v = str(v)
v = json.dumps(v)
converted[k] = v
return converted

Expand Down

0 comments on commit 8b3c578

Please sign in to comment.