-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Labels
Description
Describe the bug
When using DefaultRequestExecutor with HTTPS_PROXY env variable being set, retrying request fails with error The "options.agent" property must be one of Agent-like Object, undefined, or false. Received an instance of Object, which is coming from node http(s) library.
The cause.
- We're setting "agent" to an object of type
HttpsProxyAgent- https://github.com/okta/okta-sdk-nodejs/blob/master/src/http.js#L64 - When retrying request, we deepCopy previous request - https://github.com/okta/okta-sdk-nodejs/blob/master/src/default-request-executor.js#L36
- After deep copying object, "agent" is no longer an instance of
HttpsProxyAgent, and that's the cause why node http(s) library throws an error.
Reproduction Steps?
- Run library with HTTPS_PROXY being set.
- Trigger request retry (e.g. API limit error)
- Error
The "options.agent" property must be one of Agent-like Object, undefined, or false. Received an instance of Objectis thrown.
SDK Versions
7.0.1
Additional Information
No response
Reactions are currently unavailable