Set Content-Type header in registry client ReadFrom

Client ReadFrom doesn't set Content-Type header leading to server
side implementor to assume it's application/octet-stream. This commit
makes this explicit on the client side.

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
This commit is contained in:
Milos Gajdos 2023-08-15 08:46:48 +01:00
parent ff46bf1c41
commit 24de708d22
No known key found for this signature in database
GPG key ID: 01300E5E6D417439

View file

@ -43,6 +43,8 @@ func (hbu *httpBlobUpload) ReadFrom(r io.Reader) (n int64, err error) {
}
defer req.Body.Close()
req.Header.Set("Content-Type", "application/octet-stream")
resp, err := hbu.client.Do(req)
if err != nil {
return 0, err