Skip to content

Commit

Permalink
fix: don't copy httpAgent/httpsAgent [EXT-5676] (#2481)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjolton-contentful authored Nov 25, 2024
1 parent a93f5bc commit 0bd7514
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/adapters/REST/rest-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,14 @@ export class RestAdapter implements Adapter {
throw new TypeError('Expected parameter accessToken')
}

const copiedParams = copy(params)
// httpAgent and httpsAgent cannot be copied because they can contain private fields
copiedParams.httpAgent = params.httpAgent
copiedParams.httpsAgent = params.httpsAgent

this.params = {
...defaultHostParameters,
...copy(params),
...copiedParams,
}

this.axiosInstance = createHttpClient(axios, {
Expand Down

0 comments on commit 0bd7514

Please sign in to comment.