vagrant-cloud: use less memory when uploading
This commit is contained in:
parent
6df85f6e97
commit
a1747c21f7
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue