solr-node-client icon indicating copy to clipboard operation
solr-node-client copied to clipboard

Allow additional HTTP headers

Open mfchiz opened this issue 10 years ago • 3 comments

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

mfchiz avatar Jan 27 '15 22:01 mfchiz

That's something easy to do I think. Is it still a need? Anyone else needing this feature?

nicolasembleton avatar Aug 26 '15 08:08 nicolasembleton

@mfchiz Still a need for you?

nicolasembleton avatar Sep 01 '15 09:09 nicolasembleton

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.

rudolfbyker avatar Jun 24 '21 05:06 rudolfbyker