Browse Source

fix wrong join redirection

Xiang Li 12 years ago
parent
commit
793d5187a5
1 changed files with 1 additions and 2 deletions
  1. 1 2
      etcd.go

+ 1 - 2
etcd.go

@@ -625,10 +625,9 @@ func joinCluster(s *raft.Server, serverName string) error {
 			}
 			}
 			if resp.StatusCode == http.StatusTemporaryRedirect {
 			if resp.StatusCode == http.StatusTemporaryRedirect {
 				address := resp.Header.Get("Location")
 				address := resp.Header.Get("Location")
-				debugf("Leader is %s", address)
 				debugf("Send Join Request to %s", address)
 				debugf("Send Join Request to %s", address)
 				json.NewEncoder(&b).Encode(command)
 				json.NewEncoder(&b).Encode(command)
-				resp, err = t.Post(fmt.Sprintf("%s/join", address), &b)
+				resp, err = t.Post(address, &b)
 			} else if resp.StatusCode == http.StatusBadRequest {
 			} else if resp.StatusCode == http.StatusBadRequest {
 				debug("Reach max number machines in the cluster")
 				debug("Reach max number machines in the cluster")
 				return fmt.Errorf(errors[103])
 				return fmt.Errorf(errors[103])