mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
rafthttp: add remote in pipeline and snapshot handler when corresponding peer or remote do not exist
Fixes: #8506
This commit is contained in:
parent
3c1845604b
commit
a0361ea3f9
@ -91,7 +91,7 @@ func (h *pipelineHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if from, err := types.IDFromString(r.Header.Get("X-Server-From")); err != nil {
|
||||
if from, err := types.IDFromString(r.Header.Get("X-Server-From")); err == nil {
|
||||
if urls := r.Header.Get("X-PeerURLs"); urls != "" {
|
||||
h.tr.AddRemote(from, strings.Split(urls, ","))
|
||||
}
|
||||
@ -176,7 +176,7 @@ func (h *snapshotHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if from, err := types.IDFromString(r.Header.Get("X-Server-From")); err != nil {
|
||||
if from, err := types.IDFromString(r.Header.Get("X-Server-From")); err == nil {
|
||||
if urls := r.Header.Get("X-PeerURLs"); urls != "" {
|
||||
h.tr.AddRemote(from, strings.Split(urls, ","))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user