@servicenow/sdk 2.0.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/debug.js CHANGED
@@ -1,3 +1,16 @@
1
1
  #!/usr/bin/env node --inspect-brk
2
2
 
3
+ try {
4
+ // Allow HTTP_PROXY environment variable to be defined to proxy/intercept
5
+ // network requests
6
+ //
7
+ // https://github.com/gajus/global-agent/issues/52
8
+ const Undici = require('undici')
9
+ const ProxyAgent = Undici.ProxyAgent
10
+ const setGlobalDispatcher = Undici.setGlobalDispatcher
11
+ setGlobalDispatcher(new ProxyAgent(process.env.HTTP_PROXY))
12
+ } catch (error) {
13
+ console.debug(`HTTP_PROXY environment variable will not be used: ${error.message}`)
14
+ }
15
+
3
16
  require('@servicenow/sdk-cli')