From 57005ed7f8cb9746e791ccde27fa8525c501c20f Mon Sep 17 00:00:00 2001 From: Yang zhixiang Date: Tue, 8 Nov 2016 11:00:46 +0800 Subject: [PATCH] fix bug : join post is empty --- weed/server/raft_server.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/weed/server/raft_server.go b/weed/server/raft_server.go index 8b2ad3540..3652d7add 100644 --- a/weed/server/raft_server.go +++ b/weed/server/raft_server.go @@ -165,7 +165,7 @@ func (s *RaftServer) Join(peers []string) error { target := fmt.Sprintf("http://%s/cluster/join", strings.TrimSpace(m)) glog.V(0).Infoln("Attempting to connect to:", target) - err = postFollowingOneRedirect(target, "application/json", &b) + err = postFollowingOneRedirect(target, "application/json", b) if err != nil { glog.V(0).Infoln("Post returned error: ", err.Error()) @@ -182,9 +182,9 @@ func (s *RaftServer) Join(peers []string) error { } // a workaround because http POST following redirection misses request body -func postFollowingOneRedirect(target string, contentType string, b *bytes.Buffer) error { +func postFollowingOneRedirect(target string, contentType string, b bytes.Buffer) error { backupReader := bytes.NewReader(b.Bytes()) - resp, err := http.Post(target, contentType, b) + resp, err := http.Post(target, contentType, &b) if err != nil { return err }