Allow _all for WAN as a no-op.
This commit is contained in:
parent
316715c565
commit
aecf890054
|
@ -157,10 +157,17 @@ func (s *HTTPServer) AgentMembers(resp http.ResponseWriter, req *http.Request) (
|
||||||
}
|
}
|
||||||
|
|
||||||
segment := req.URL.Query().Get("segment")
|
segment := req.URL.Query().Get("segment")
|
||||||
if wan && segment != "" {
|
if wan {
|
||||||
resp.WriteHeader(http.StatusBadRequest)
|
switch segment {
|
||||||
fmt.Fprint(resp, "Cannot provide a segment with wan=true")
|
case "", api.AllSegments:
|
||||||
return nil, nil
|
// The zero value and the special "give me all members"
|
||||||
|
// key are ok, otherwise the argument doesn't apply to
|
||||||
|
// the WAN.
|
||||||
|
default:
|
||||||
|
resp.WriteHeader(http.StatusBadRequest)
|
||||||
|
fmt.Fprint(resp, "Cannot provide a segment with wan=true")
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var members []serf.Member
|
var members []serf.Member
|
||||||
|
|
Loading…
Reference in New Issue