From db2ab96a2ea0ec9de64edc1fcb0eb60b4c9add4c Mon Sep 17 00:00:00 2001 From: Chengxuan Xing Date: Fri, 12 Apr 2024 17:22:03 +0100 Subject: [PATCH] restore certs Signed-off-by: Chengxuan Xing --- src/health/health.controller.ts | 17 ++++++++++------- src/utils.ts | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/health/health.controller.ts b/src/health/health.controller.ts index 179c409..875bee7 100644 --- a/src/health/health.controller.ts +++ b/src/health/health.controller.ts @@ -21,13 +21,16 @@ export class HealthController { @HealthCheck() readiness() { return this.health.check([ - () => - this.http.pingCheck('ethconnect', `${this.blockchain.baseUrl}/status`, { - auth: { - username: this.blockchain.username, - password: this.blockchain.password, - }, - }), + () => { + const httpOptions = getHttpRequestOptions( + this.blockchain.username, + this.blockchain.password, + ); + return this.http.pingCheck('ethconnect', `${this.blockchain.baseUrl}/status`, { + auth: httpOptions.auth, + httpAgent: httpOptions.httpAgent, + }); + }, ]); } } diff --git a/src/utils.ts b/src/utils.ts index fbcadbc..bd6c61d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -46,7 +46,7 @@ export const getWebsocketOptions = (username: string, password: string): ClientO return requestOptions; }; -export const getHttpRequestOptions = (username: string, password: string) => { +export const getHttpRequestOptions = (username: string, password: string):AxiosRequestConfig => { const requestOptions: AxiosRequestConfig = {}; if (username !== '' && password !== '') { requestOptions.auth = {