skynetservices / skydns1

DNS for skynet or any other service discovery
MIT License
528 stars 54 forks source link

Client should follow API redirects #79

Closed amuino closed 10 years ago

amuino commented 10 years ago

Since the slave skydns processes return a 301 redirect to the master for write operations, the client implementation should follow them (currently it is failing).

See the conversation and the code here

I have implemented the follow redirects behavior by updating the client's base attribute and retrying the same operation (this was simpler than other options and, since it is a 'moved permanently' response, looked reasonable)

If the approach on this PR is good, I can extend it to other write operations.

PS: I have built a test program for this, but I'm not sure how to write a test case in go.

erikstmartin commented 10 years ago

Sorry for the delay on this, been really caught up with other things. Let me pull this down and check it out so we can get it merged.

@miekg Do you want to also take a look as well, I want to make sure it doesn't conflict with anything you're working on

miekg commented 10 years ago

lgmt