diff --git a/components/cli/image_build.go b/components/cli/image_build.go index 6fde75dcfd..411d5493ea 100644 --- a/components/cli/image_build.go +++ b/components/cli/image_build.go @@ -29,7 +29,7 @@ func (cli *Client) ImageBuild(ctx context.Context, buildContext io.Reader, optio return types.ImageBuildResponse{}, err } headers.Add("X-Registry-Config", base64.URLEncoding.EncodeToString(buf)) - headers.Set("Content-Type", "application/tar") + headers.Set("Content-Type", "application/x-tar") serverResp, err := cli.postRaw(ctx, "/build", query, buildContext, headers) if err != nil { diff --git a/components/cli/image_build_test.go b/components/cli/image_build_test.go index b9d04f817a..1e18b7bda8 100644 --- a/components/cli/image_build_test.go +++ b/components/cli/image_build_test.go @@ -170,8 +170,8 @@ func TestImageBuild(t *testing.T) { return nil, fmt.Errorf("X-Registry-Config header not properly set in the request. Expected '%s', got %s", buildCase.expectedRegistryConfig, registryConfig) } contentType := r.Header.Get("Content-Type") - if contentType != "application/tar" { - return nil, fmt.Errorf("Content-type header not properly set in the request. Expected 'application/tar', got %s", contentType) + if contentType != "application/x-tar" { + return nil, fmt.Errorf("Content-type header not properly set in the request. Expected 'application/x-tar', got %s", contentType) } // Check query parameters diff --git a/components/cli/plugin_create.go b/components/cli/plugin_create.go index a660ba5733..27954aa573 100644 --- a/components/cli/plugin_create.go +++ b/components/cli/plugin_create.go @@ -12,7 +12,7 @@ import ( // PluginCreate creates a plugin func (cli *Client) PluginCreate(ctx context.Context, createContext io.Reader, createOptions types.PluginCreateOptions) error { headers := http.Header(make(map[string][]string)) - headers.Set("Content-Type", "application/tar") + headers.Set("Content-Type", "application/x-tar") query := url.Values{} query.Set("name", createOptions.RepoName)