From 7881791a913dacef9562e7a33a8186503d7967bf Mon Sep 17 00:00:00 2001 From: kannappanr <30541348+kannappanr@users.noreply.github.com> Date: Wed, 19 Dec 2018 14:31:45 -0800 Subject: [PATCH] CopyObject:Set Content-Type to application/octet-stream if it is not set (#6958) --- cmd/handler-utils.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/handler-utils.go b/cmd/handler-utils.go index 2074b3ac8..5ad63040f 100644 --- a/cmd/handler-utils.go +++ b/cmd/handler-utils.go @@ -134,6 +134,11 @@ func extractMetadata(ctx context.Context, r *http.Request) (metadata map[string] return nil, err } + // Set content-type to default value if it is not set. + if _, ok := metadata["content-type"]; !ok { + metadata["content-type"] = "application/octet-stream" + } + // Success. return metadata, nil }