reactivesearch icon indicating copy to clipboard operation
reactivesearch copied to clipboard

The headers are not being passed to request

Open jyxia opened this issue 5 years ago • 7 comments

In our app, we are passing customized headers to initReactivesearch and not seeing the customized headers being passed to the actual request. I think the reason is that the headers always got set to an empty object {} in this line https://github.com/appbaseio/appbase-js/blob/develop/src/core/index.js#L58.

Shouldn't this line be this.headers = config.headers || {}? otherwise any AppBase instance would always have an empty object in headers.

jyxia avatar Aug 20 '20 20:08 jyxia

You can use setHeaders method on appbase instance.

bietkul avatar Aug 21 '20 13:08 bietkul

@bietkul Hey thanks, I saw that method. But we're using initReactivesearch in ReactiveSearch to initialize the initial state on SSR, do we have the access to the AppBase instance in there? see here: https://github.com/appbaseio/reactivesearch/blob/99dfb90083710ea6d96a4ca9e94280a88bc5a599/packages/web/src/server/index.js#L91

initReactivesearch instantiate AppBase with the headers passed in from settings and didn't use setHeaders. Should I file an issue in ReactiveSearch then?

jyxia avatar Aug 21 '20 13:08 jyxia

@bietkul can you please provide some input? I know this issue was closed, but it would be helpful if you can kindly reply. Thanks.

jyxia avatar Aug 25 '20 13:08 jyxia

@jyxia Please file an issue on ReactiveSearch instead. It is not an issue with appbase-js.

bietkul avatar Aug 25 '20 13:08 bietkul

can i work on this @bietkul

ashishcas avatar Oct 07 '21 19:10 ashishcas