From 24de708d229e4b67fb434151895e909f31aa08e6 Mon Sep 17 00:00:00 2001 From: Milos Gajdos Date: Tue, 15 Aug 2023 08:46:48 +0100 Subject: [PATCH] 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 --- registry/client/blob_writer.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/registry/client/blob_writer.go b/registry/client/blob_writer.go index 7b467d84..e76341de 100644 --- a/registry/client/blob_writer.go +++ b/registry/client/blob_writer.go @@ -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