fix(server): dispatch SetClusterConfigCommand correctly

This commit is contained in:
Yicheng Qin 2014-04-22 14:02:54 -07:00
parent 9af9438ed0
commit c7116a37c0

View File

@ -276,9 +276,9 @@ func (s *Server) Dispatch(c raft.Command, w http.ResponseWriter, req *http.Reque
var url string
switch c.(type) {
case *JoinCommandV1, *RemoveCommandV1:
url, _ = ps.registry.PeerURL(leader)
case *JoinCommandV2, *RemoveCommandV2:
case *JoinCommandV1, *RemoveCommandV1,
*JoinCommandV2, *RemoveCommandV2,
*SetClusterConfigCommand:
url, _ = ps.registry.PeerURL(leader)
default:
url, _ = ps.registry.ClientURL(leader)