Fix galaxy publish sha256 value format. (#67942)

* Fix galaxy publish sha256 value format.

The multipart/form content used for the body
of the POST to /api/automation-hub/v3/collections
was missing a newline before the line with the value
of the sha256.

automation-hub/galaxy/django skips the field entirely in
that case and automation-hub code will use None for default
to indicate that no sha256 is provided (an available option).

Fixes ansible/galaxy-dev#246

* Add changelog fragment

Co-authored-by: Matt Martz <matt@sivel.net>
pull/69451/head
Adrian Likins 5 years ago committed by GitHub
parent 5b9418c06c
commit cd8dd4a272
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,3 @@
bugfixes:
- ansible-galaxy - Fix ``multipart/form-data`` body to include extra CRLF
(https://github.com/ansible/ansible/pull/67942)

@ -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,

Loading…
Cancel
Save