solr-node-client
solr-node-client copied to clipboard
Allow additional HTTP headers
Websolr has a authentication approach that requires additional http headers added to the solr web request to enable per request authentication. https://github.com/omc/websolr-guides/blob/master/websolr-advanced-auth.md
It would be helpful if you could add these headers to the configuration of the solr client like so:
//create security token headers for client var headers = { 'X-Websolr-Time' : time, 'X-Websolr-Nonce' : nonce, 'X-Websolr-Auth' : auth }
// create a client with these headers
var client = solr.createClient({
host:"index.websolr.com",
port:443,
path:"/solr/2435",
secure:true,
headers:headers
});
I imagine there are other times which folks could want custom headers added to the web requests. I have a working version locally and will submit a pull request for this functionality.
Best, Matt
That's something easy to do I think. Is it still a need? Anyone else needing this feature?
@mfchiz Still a need for you?
I also need this, but for totally different reasons. I also see some issues on here that request other tweaks like using a proxy. I think the best approach would be to make the request pluggable, allowing the user to provide their own instance of http, https, request or axios.