From 5603323fe6e62cd4411ccb9826fa269624a76212 Mon Sep 17 00:00:00 2001 From: Leandro Costa Date: Sun, 21 Sep 2025 20:41:26 -0300 Subject: [PATCH] feat: parse headers --- package.json | 2 +- src/lhisp-oauth-client.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 27bb6b6..e884514 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lhisp-oauth-client-dev", - "version": "1.0.33", + "version": "1.0.34", "main": "src/index", "types": "src/index.d.ts", "repository": { diff --git a/src/lhisp-oauth-client.ts b/src/lhisp-oauth-client.ts index d6c4ad6..12aa603 100644 --- a/src/lhisp-oauth-client.ts +++ b/src/lhisp-oauth-client.ts @@ -164,15 +164,17 @@ export class LhispOauthClient { data, params, contentType = ContentType.APPLICATION_JSON, + headers, ...opt }: ExecutarRequestParams): Promise { try { await this.getAccessToken(); - const headers = { + const actualHeaders = { "Content-Type": contentType, [this.tokenHeaderName]: this.getAuthToken(), ...(this.headers || {}), + ...(headers || {}), }; const response = await axios.request({ @@ -180,7 +182,7 @@ export class LhispOauthClient { method, url: `${this.apiUrl}${path}`, httpsAgent: this.agent, - headers: { ...headers, ...opt.headers }, + headers: actualHeaders, data, params, timeout: this.timeout,