vagrant-cloud: use less memory when uploading

This commit is contained in:
Matthew Hooker 2017-06-12 11:07:33 -07:00
parent 6df85f6e97
commit a1747c21f7
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
1 changed files with 1 additions and 9 deletions

View File

@ -110,15 +110,7 @@ func (v VagrantCloudClient) Upload(path string, url string) (*http.Response, err
defer file.Close() defer file.Close()
body := &bytes.Buffer{} request, err := http.NewRequest("PUT", url, file)
_, err = io.Copy(body, file)
if err != nil {
return nil, fmt.Errorf("Error uploading file: %s", err)
}
request, err := http.NewRequest("PUT", url, body)
if err != nil { if err != nil {
return nil, fmt.Errorf("Error preparing upload request: %s", err) return nil, fmt.Errorf("Error preparing upload request: %s", err)