hashicorp/consul — pull request #46 by jpfuentes2 (2014-04-17 18:56:06+00:00)
Title: Ensure we write json header before writing bytes

In net/http once we've issued a Write() the response is sent
over the wire including the header! The tests didn't catch
this because I used a net/http/httptest.RequestRecorder
which doesn't follow those semantics.