feat: headers
All checks were successful
CI Pipeline / build-and-test (push) Successful in 2m3s
CI Pipeline / publish (push) Successful in 44s

This commit is contained in:
Leandro Costa 2025-09-21 20:48:26 -03:00
parent 5603323fe6
commit f8a6af2958
2 changed files with 5 additions and 5 deletions

View file

@ -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": {

View file

@ -164,17 +164,17 @@ export class LhispOauthClient<iAccessToken extends AccessToken = AccessToken> {
data,
params,
contentType = ContentType.APPLICATION_JSON,
headers,
headers: paramsHeaders,
...opt
}: ExecutarRequestParams): Promise<ResponseType> {
try {
await this.getAccessToken();
const actualHeaders = {
const headers = {
"Content-Type": contentType,
[this.tokenHeaderName]: this.getAuthToken(),
...(this.headers || {}),
...(headers || {}),
...(paramsHeaders || {}),
};
const response = await axios.request<ResponseType>({
@ -182,7 +182,7 @@ export class LhispOauthClient<iAccessToken extends AccessToken = AccessToken> {
method,
url: `${this.apiUrl}${path}`,
httpsAgent: this.agent,
headers: actualHeaders,
headers,
data,
params,
timeout: this.timeout,