elasticsearch/elasticsearch — pull request #2723 by spinscale (2013-03-04 08:02:26+00:00)
Title: Set custom headers in HTTP responses

Hi,

this patch allows to set custom headers in HTTP responses (like setting the WWW-Authenticate header for basic auth) by adding RestRequest.addHeader() method. There are are few caveats in my opinion, which should be considered before inclusion:

Every HTTP request now instantiates a hashmap (with a predefined size of 2). I am not sure if this is a good thing, as most request (especially all the elasticsearch core ones) do not set any headers. We could alternatively use some sort of init() method and do not create the hashmap on request instantiation.

This should close #2540