mia-platform / custom-plugin-lib

Library that allows you to define Mia-Platform custom plugins easily
https://www.mia-platform.eu/
Apache License 2.0
29 stars 8 forks source link

getHttpClient from service does not forward mia headers #348

Closed FabioNappi closed 1 year ago

FabioNappi commented 1 year ago

The docs do not discriminate between the getHttpClient functions decorated to the fastify instance and request instance, but there is a difference indeed.

Using the above function decorated to the fastify instance, the obtained client will not forward Mia headers; while using the same function decorated to the request instance, the obtained client will actually forward those headers.

I would expect that the client obtained from the fastify instance is still able to forward mia headers or at least point this difference in the docs.

environment

custom-plugin-lib: 5.1.3

davidebianchi commented 1 year ago

Is it not possible to access to the headers from the instance. So, we should add the limitation in docs I suppose. Can you open a PR?

FabioNappi commented 1 year ago

Here it is https://github.com/mia-platform/custom-plugin-lib/pull/349

davidebianchi commented 1 year ago

Merged into master.