Handle rejected peers properly
This commit is contained in:
parent
d550596d52
commit
1c468ff0fe
@ -71,6 +71,13 @@ func Authenticate(store peering.Store, key *rsa.PublicKey, funcs ...OptionFunc)
|
||||
return
|
||||
}
|
||||
sendError(w, http.StatusUnauthorized)
|
||||
case ErrPeerRejected:
|
||||
if err := store.UpdateLastContact(serverClaims.PeerID, r.RemoteAddr, time.Now()); err != nil {
|
||||
logger.Printf("[ERROR] %s", err)
|
||||
sendError(w, http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
sendError(w, http.StatusForbidden)
|
||||
default:
|
||||
sendError(w, http.StatusInternalServerError)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user