jurmous/etcd4j — pull request #7 by slintes (2014-10-01 21:21:15+00:00)
Title: fixed redirect: new Url contains host and port

Hi, I found an issue with redirects: the url which you get with the location header in the redirect response contains also host and port, so you need to use that one and not the initial host and port. See https://github.com/jurmous/etcd4j/blob/master/src/main/java/mousio/etcd4j/transport/EtcdKeyResponseHandler.java#L47.

Redirects appear when you run etcd in a cluster. One machine will be the leader and all request are redirected to that leader. I have a test setup using vagrant, see https://github.com/slintes/etcdTest.

Greetings, Marc

PS: not sure if "requestUrl.contains("://")" makes sense, was just my first idea...