From a1747c21f73b0438690ed17b9bde6e6a936bbd2d Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Mon, 12 Jun 2017 11:07:33 -0700 Subject: [PATCH] vagrant-cloud: use less memory when uploading --- post-processor/vagrant-cloud/client.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/post-processor/vagrant-cloud/client.go b/post-processor/vagrant-cloud/client.go index 0c475075d..a3df938e6 100644 --- a/post-processor/vagrant-cloud/client.go +++ b/post-processor/vagrant-cloud/client.go @@ -110,15 +110,7 @@ func (v VagrantCloudClient) Upload(path string, url string) (*http.Response, err defer file.Close() - body := &bytes.Buffer{} - - _, err = io.Copy(body, file) - - if err != nil { - return nil, fmt.Errorf("Error uploading file: %s", err) - } - - request, err := http.NewRequest("PUT", url, body) + request, err := http.NewRequest("PUT", url, file) if err != nil { return nil, fmt.Errorf("Error preparing upload request: %s", err)