silas/node-consul — pull request #3 by chrisDeFouRire (2014-07-24 11:09:36+00:00)
Title: Support blocking queries to /health

Here's a very modest proposal for enhancement, to make it possible to use blocking queries with `consul.health.*` endpoints... It's backwards compatible...

To use blocking queries, you must provide the `?index= param` which you obtained in the response headers of the previous call. `health` HTTP responses do not include a `ModifyIndex` field like the `kv`ones. Instead, you must use the `X-Consul-Index` HTTP header... But in `consul.health`, only the `res.body` is returned.

This modification adds an optional `headers` parameter to the callback so the caller can get the `X-Consul-Index` or other consul specific headers (do we have a leader ? time of last contact) as per the [consul.io docs](http://www.consul.io/docs/agent/http.html)...

If the caller implements a classic 2 params callback, the headers are silently discarded.
If he implements the 3 params callback, he'll receive the headers.

What do you think ?

*Example headers:*
```
X-Consul-Index: 235237
X-Consul-Knownleader: true
X-Consul-Lastcontact: 0
```