Skip to content

Commit 07f2282

Browse files
feat( create-http-client): Enable axios proxy
1 parent 7bab78d commit 07f2282

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/create-http-client.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ import rateLimit from './rate-limit'
1313
* @prop {string=} host - Alternate host
1414
* @prop {Object=} httpAgent - HTTP agent for node
1515
* @prop {Object=} httpsAgent - HTTPS agent for node
16+
* @prop {Object=} proxy - Axios proxy config
1617
* @prop {Object=} headers - Additional headers
1718
* @return {Object} Initialized axios instance
1819
*/
1920
export default function createHttpClient (axios, httpClientParams) {
20-
const {space, accessToken, insecure, host, defaultHostname, httpAgent, httpsAgent} = httpClientParams
21+
const {space, accessToken, insecure, host, defaultHostname, httpAgent, httpsAgent, proxy} = httpClientParams
2122
let {headers} = httpClientParams
2223
let [hostname, port] = (host && host.split(':')) || []
2324
hostname = hostname || defaultHostname
@@ -42,6 +43,7 @@ export default function createHttpClient (axios, httpClientParams) {
4243
headers: headers,
4344
httpAgent: httpAgent,
4445
httpsAgent: httpsAgent,
46+
proxy: proxy,
4547
paramsSerializer: qs.stringify
4648
})
4749
instance.httpClientParams = httpClientParams

0 commit comments

Comments
 (0)