diff --git a/changelogs/fragments/67942-fix-galaxy-multipart.yml b/changelogs/fragments/67942-fix-galaxy-multipart.yml new file mode 100644 index 00000000000..bf756bdecc8 --- /dev/null +++ b/changelogs/fragments/67942-fix-galaxy-multipart.yml @@ -0,0 +1,3 @@ +bugfixes: +- ansible-galaxy - Fix ``multipart/form-data`` body to include extra CRLF + (https://github.com/ansible/ansible/pull/67942) diff --git a/lib/ansible/galaxy/api.py b/lib/ansible/galaxy/api.py index d8e863c61d6..b9de56d0592 100644 --- a/lib/ansible/galaxy/api.py +++ b/lib/ansible/galaxy/api.py @@ -435,6 +435,7 @@ class GalaxyAPI: form = [ part_boundary, b"Content-Disposition: form-data; name=\"sha256\"", + b"", to_bytes(secure_hash_s(data, hash_func=hashlib.sha256), errors='surrogate_or_strict'), part_boundary, b"Content-Disposition: file; name=\"file\"; filename=\"%s\"" % b_file_name,