coreos/etcd — pull request #628 by metaflow (2014-03-15 09:17:42+00:00)
Title: fix(api) fix of redirect loop when there is no leader

I tried to solve the following issue:

when client ask partitioned peer to get actual value of the key it will get HTTP redirect to same peer.
For example I have a setup of two peers on 4001 (leader) and 4002 (follower). After leader died in accident I ask peer
`curl -L http://127.0.0.1:4002/v2/keys/my`
and get some value. That is OK. But request of
`curl -L http://127.0.0.1:4002/v2/keys/my?consistent=true`
leads to curl error "too many redirects" because peer don't know who is the leader and use empty URL as path to leader and return 301 to `/v2/keys/my?consistent=true` (to himself).

Should I add specific test for this?