From e62e122625d97856ddf92dd8e2d2b56f7c737bda Mon Sep 17 00:00:00 2001 From: Jack Pearkes Date: Mon, 21 Jul 2014 10:30:51 -0400 Subject: [PATCH] post-processor/vagrant-cloud: fix multi-part corruption --- post-processor/vagrant-cloud/client.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/post-processor/vagrant-cloud/client.go b/post-processor/vagrant-cloud/client.go index 783745c67..104f13832 100644 --- a/post-processor/vagrant-cloud/client.go +++ b/post-processor/vagrant-cloud/client.go @@ -6,11 +6,9 @@ import ( "fmt" "io" "log" - "mime/multipart" "net/http" "net/url" "os" - "path/filepath" "strings" ) @@ -113,13 +111,8 @@ func (v VagrantCloudClient) Upload(path string, url string) (*http.Response, err defer file.Close() body := &bytes.Buffer{} - writer := multipart.NewWriter(body) - part, err := writer.CreateFormFile("file", filepath.Base(path)) - if err != nil { - return nil, err - } - _, err = io.Copy(part, file) + _, err = io.Copy(body, file) if err != nil { return nil, fmt.Errorf("Error uploading file: %s", err)