diff --git a/package.json b/package.json index e884514..9c554ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lhisp-oauth-client-dev", - "version": "1.0.34", + "version": "1.0.35", "main": "src/index", "types": "src/index.d.ts", "repository": { diff --git a/src/lhisp-oauth-client.ts b/src/lhisp-oauth-client.ts index 12aa603..1b5b2d8 100644 --- a/src/lhisp-oauth-client.ts +++ b/src/lhisp-oauth-client.ts @@ -164,17 +164,17 @@ export class LhispOauthClient { data, params, contentType = ContentType.APPLICATION_JSON, - headers, + headers: paramsHeaders, ...opt }: ExecutarRequestParams): Promise { try { await this.getAccessToken(); - const actualHeaders = { + const headers = { "Content-Type": contentType, [this.tokenHeaderName]: this.getAuthToken(), ...(this.headers || {}), - ...(headers || {}), + ...(paramsHeaders || {}), }; const response = await axios.request({ @@ -182,7 +182,7 @@ export class LhispOauthClient { method, url: `${this.apiUrl}${path}`, httpsAgent: this.agent, - headers: actualHeaders, + headers, data, params, timeout: this.timeout,