fix wrong join redirection

release-0.4
Xiang Li 2013-08-05 17:02:27 -07:00
parent c6a4321310
commit 793d5187a5
1 changed files with 1 additions and 2 deletions

View File

@ -625,10 +625,9 @@ func joinCluster(s *raft.Server, serverName string) error {
}
if resp.StatusCode == http.StatusTemporaryRedirect {
address := resp.Header.Get("Location")
debugf("Leader is %s", address)
debugf("Send Join Request to %s", address)
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 {
debug("Reach max number machines in the cluster")
return fmt.Errorf(errors[103])