Skip to content

Commit 77e897d

Browse files
authored
Merge pull request #1496 from yoshi-taka/https-proxy-agent
chore(deps): upgrade http(s)-proxy-agent
2 parents a513814 + 66057ae commit 77e897d

File tree

6 files changed

+16
-30
lines changed

6 files changed

+16
-30
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@
152152
"core-js": "^3.8.2",
153153
"debug": "^4.1.1",
154154
"fast-json-patch": "^3.0.0-1",
155-
"http-proxy-agent": "^5.0.0",
156-
"https-proxy-agent": "^5.0.1",
155+
"http-proxy-agent": "^7.0.2",
156+
"https-proxy-agent": "^7.0.2",
157157
"hyperlinker": "^1.0.0",
158158
"ini": "^5.0.0",
159159
"json5": "^2.2.3",

source/api/_tests/fetch.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ describe("fetch", () => {
133133

134134
let options: node_fetch.RequestInit = { agent: undefined }
135135
await api(url, options, true, { HTTPS_PROXY: proxyUrl })
136-
let agent = options.agent as HttpsProxyAgent
136+
let agent = options.agent as HttpsProxyAgent<string>
137137
expect(agent["proxy"].href).toBe(proxyUrl)
138138
})
139139

@@ -145,7 +145,7 @@ describe("fetch", () => {
145145

146146
let options: node_fetch.RequestInit = { agent: undefined }
147147
await api(url, options, true, { https_proxy: proxyUrl })
148-
let agent = options.agent as HttpsProxyAgent
148+
let agent = options.agent as HttpsProxyAgent<string>
149149
expect(agent["proxy"].href).toBe(proxyUrl)
150150
})
151151

@@ -157,7 +157,7 @@ describe("fetch", () => {
157157

158158
let options: node_fetch.RequestInit = { agent: undefined }
159159
await api(url, options, true, { HTTP_PROXY: proxyUrl })
160-
let agent = options.agent as HttpProxyAgent
160+
let agent = options.agent as HttpProxyAgent<string>
161161
expect(agent["proxy"].href).toBe(proxyUrl)
162162
})
163163

@@ -169,7 +169,7 @@ describe("fetch", () => {
169169

170170
let options: node_fetch.RequestInit = { agent: undefined }
171171
await api(url, options, true, { http_proxy: proxyUrl })
172-
let agent = options.agent as HttpProxyAgent
172+
let agent = options.agent as HttpProxyAgent<string>
173173
expect(agent["proxy"].href).toBe(proxyUrl)
174174
})
175175
})

source/api/fetch.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { debug } from "../debug"
22
import * as node_fetch from "node-fetch"
33

4-
import HttpProxyAgent from "http-proxy-agent"
5-
import HttpsProxyAgent from "https-proxy-agent"
4+
import { HttpProxyAgent } from "http-proxy-agent"
5+
import { HttpsProxyAgent } from "https-proxy-agent"
66

77
import AsyncRetry from "async-retry"
88

@@ -113,7 +113,7 @@ export function api(
113113

114114
if (!agent && proxy) {
115115
let secure = url.toString().startsWith("https")
116-
init.agent = secure ? HttpsProxyAgent(proxy) : HttpProxyAgent(proxy)
116+
init.agent = secure ? new HttpsProxyAgent(proxy) : new HttpProxyAgent(proxy)
117117
}
118118

119119
return retryableFetch(url, init).then(async (response: node_fetch.Response) => {

source/platforms/bitbucket_cloud/BitBucketCloudAPI.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { debug } from "../../debug"
22
import * as node_fetch from "node-fetch"
33
import { Agent } from "http"
4-
import HttpsProxyAgent from "https-proxy-agent"
4+
import { HttpsProxyAgent } from "https-proxy-agent"
55
import { URLSearchParams } from "url"
66

77
import { Env } from "../../ci_source/ci_source"
@@ -391,7 +391,7 @@ export class BitBucketCloudAPI implements BitBucketCloudAPIDSL {
391391
let agent: Agent | undefined = undefined
392392
let proxy = process.env.http_proxy || process.env.https_proxy
393393
if (proxy) {
394-
agent = HttpsProxyAgent(proxy)
394+
agent = new HttpsProxyAgent(proxy)
395395
}
396396

397397
return this.fetch(

source/platforms/bitbucket_server/BitBucketServerAPI.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { debug } from "../../debug"
22
import * as node_fetch from "node-fetch"
33
import { Agent } from "http"
4-
import HttpsProxyAgent from "https-proxy-agent"
4+
import { HttpsProxyAgent } from "https-proxy-agent"
55

66
import {
77
BitBucketServerPRDSL,
@@ -354,7 +354,7 @@ export class BitBucketServerAPI implements BitBucketServerAPIDSL {
354354
let agent: Agent | undefined = undefined
355355
let proxy = process.env.http_proxy || process.env.https_proxy
356356
if (proxy) {
357-
agent = HttpsProxyAgent(proxy)
357+
agent = new HttpsProxyAgent(proxy)
358358
}
359359

360360
return this.fetch(

yarn.lock

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,11 +1677,6 @@
16771677
dependencies:
16781678
"@sinonjs/commons" "^1.7.0"
16791679

1680-
"@tootallnate/once@2":
1681-
version "2.0.0"
1682-
resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf"
1683-
integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==
1684-
16851680
"@tootallnate/quickjs-emscripten@^0.23.0":
16861681
version "0.23.0"
16871682
resolved "https://registry.yarnpkg.com/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz#db4ecfd499a9765ab24002c3b696d02e6d32a12c"
@@ -4028,32 +4023,23 @@ html-escaper@^2.0.0:
40284023
resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453"
40294024
integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==
40304025

4031-
http-proxy-agent@^5.0.0:
4032-
version "5.0.0"
4033-
resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43"
4034-
integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==
4035-
dependencies:
4036-
"@tootallnate/once" "2"
4037-
agent-base "6"
4038-
debug "4"
4039-
4040-
http-proxy-agent@^7.0.0, http-proxy-agent@^7.0.1:
4026+
http-proxy-agent@^7.0.0, http-proxy-agent@^7.0.1, http-proxy-agent@^7.0.2:
40414027
version "7.0.2"
40424028
resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz#9a8b1f246866c028509486585f62b8f2c18c270e"
40434029
integrity sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==
40444030
dependencies:
40454031
agent-base "^7.1.0"
40464032
debug "^4.3.4"
40474033

4048-
https-proxy-agent@^5.0.0, https-proxy-agent@^5.0.1:
4034+
https-proxy-agent@^5.0.0:
40494035
version "5.0.1"
40504036
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6"
40514037
integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==
40524038
dependencies:
40534039
agent-base "6"
40544040
debug "4"
40554041

4056-
https-proxy-agent@^7.0.6:
4042+
https-proxy-agent@^7.0.2, https-proxy-agent@^7.0.6:
40574043
version "7.0.6"
40584044
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz#da8dfeac7da130b05c2ba4b59c9b6cd66611a6b9"
40594045
integrity sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==

0 commit comments

Comments
 (0)