There is some commented-out code in SolrDispatchFilter.doFilter:

// add info to http headers
//TODO: See SOLR-232 and SOLR-267.
 /*try {
   NamedList solrRspHeader = solrRsp.getResponseHeader();
  for (int i=0; i<solrRspHeader.size(); i++) {
((javax.servlet.http.HttpServletResponse) response).addHeader(("Solr-" + solrRspHeader.getName(i)), String.valueOf(solrRspHeader.getVal(i)));
  }
 } catch (ClassCastException cce) {
log.log(Level.WARNING, "exception adding response header log information", cce);
 }*/

And there is a comment from Grant on SOLR-267 that "The changes to SolrDispatchFilter can screw up SolrJ when you have explicit=all ... so I'm going to ... comment out #2 and put a TODO: there and someone can address it on SOLR-232".

I did not see a separate Jira issue for arbitrarily setting HTTP headers from response writers.

-- Jack Krupansky

-----Original Message----- From: Markus Jelsma
Sent: Monday, June 04, 2012 7:10 AM
To: solr-user@lucene.apache.org
Subject: Add HTTP-header from ResponseWriter

Hi,

There has been discussion before on how to add/set a HTTP-header from a ResponseWriter. That was about adding the number of found documents for a CSVResponseWriter. We also need to set the number of found documents, in this case for the JSONResponseWriter. or any ResponseWriter. Is there any progress or open issue i am not aware of? Can the current (trunk) response framework already set or add an HTTP-header?

Thanks,
Markus

Reply via email to