Closed alonisser closed 6 years ago
Good point.
I think adding additional headers on the options
object in the module's constructor is the most simple solution.
The only problem is that you'll need to create a new instance of the search client when you want a new value for the header.
To clarify, I mean this:
var client = AzureSearch({
url: "https://XXX.search.windows.net",
key: "YYY",
headers : { "x-my-custom-header" : "foo" }
});
Following the docs, a recommended way of tracking requests is adding headers But following the code search method uses
post
method which does not passoverriders
toexecution
function, which is the way to pass headers. Is there a work around this ? A recommended technical design for a PR?