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>
This commit is contained in:
Adrian Likins 2020-05-11 13:52:38 -04:00 committed by GitHub
parent 5b9418c06c
commit cd8dd4a272
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

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

View file

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