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,