Skip to content

Commit

Permalink
fix: fix getHttpClient fn
Browse files Browse the repository at this point in the history
  • Loading branch information
davidebianchi committed May 10, 2023
1 parent 9880e21 commit 611d55d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,12 @@ function getHttpClientFromRequest(url, baseOptions = {}) {
return new HttpClient(url, serviceHeaders, options, this.httpClientMetrics)
}

function getHttpClient(url, baseOptions = {}) {
return new HttpClient(url, {}, baseOptions, this.httpClientMetrics)
function getHttpClient(url, baseOptions = {}, httpClientMetrics = {}) {
return new HttpClient(url, {}, baseOptions, httpClientMetrics)
}

function getHttpClientFastifyDecoration(url, baseOptions = {}) {
return getHttpClient(url, baseOptions, this.httpClientMetrics)
}

function getHeadersToProxy({ isMiaHeaderInjected = true } = {}) {
Expand Down Expand Up @@ -283,7 +287,7 @@ function decorateFastify(fastify) {

fastify.decorate('getDirectServiceProxy', getDirectlyServiceBuilderFromService)
fastify.decorate('getServiceProxy', getServiceBuilderFromService)
fastify.decorate('getHttpClient', getHttpClient)
fastify.decorate('getHttpClient', getHttpClientFastifyDecoration)
fastify.decorate('httpClientMetrics', httpClientMetrics)
}

Expand Down

0 comments on commit 611d55d

Please sign in to comment.