From cb121c3f2061817ae1968d1b1e18dde58cfd4ca8 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 (cherry picked from commit 24de708d229e4b67fb434151895e909f31aa08e6) Signed-off-by: Sebastiaan van Stijn --- 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 695bf852f..dac030c73 100644 --- a/registry/client/blob_writer.go +++ b/registry/client/blob_writer.go @@ -42,6 +42,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