diff --git a/api/cloudcontroller/ccv3/request.go b/api/cloudcontroller/ccv3/request.go index dc799fc59ec..46812f4f4ba 100644 --- a/api/cloudcontroller/ccv3/request.go +++ b/api/cloudcontroller/ccv3/request.go @@ -69,7 +69,7 @@ func (requester *RealRequester) newHTTPRequest(passedRequest requestOptions) (*c request.Header.Set("Accept", "application/json") } - if request.Header.Get("Content-Type") == "" { + if passedRequest.RequestName != internal.GetDropletBitsRequest && request.Header.Get("Content-Type") == "" { request.Header.Set("Content-Type", "application/json") } diff --git a/api/cloudcontroller/ccv3/requester.go b/api/cloudcontroller/ccv3/requester.go index f0982fc6293..a6269a71aa6 100644 --- a/api/cloudcontroller/ccv3/requester.go +++ b/api/cloudcontroller/ccv3/requester.go @@ -7,6 +7,7 @@ import ( "io" "net/http" "runtime" + "strings" "code.cloudfoundry.org/cli/api/cloudcontroller" "code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/internal" @@ -160,6 +161,10 @@ func (requester *RealRequester) MakeRequestSendReceiveRaw( return nil, nil, err } + if strings.Contains(URL, "droplet") && strings.Contains(URL, "download") { + request.Header.Del("Content-Type") + } + response := cloudcontroller.Response{} err = requester.connection.Make(request, &response)