From my Elasticsearch plugin, I want to set HTTP response headers. What I do is:
And this works, but when another request comes along, Elasticsearch will still carry "header1" as a response header. In other words, I expected the response headers to be transient, i.e. to be reset for every request.
Or at least, I expected to be able to be able clear/remove/overwrite them, but this is not possible as for current API.
// Throws Method threw 'java.lang.UnsupportedOperationException' exception. threadPool.getThreadContext().getResponseHeaders().clear();
Please advise, am I doing this wrong?