mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-06 09:03:15 +08:00
.
This commit is contained in:
@@ -299,19 +299,19 @@ describe('proxy', () => {
|
||||
it('proxy settings return ProxyAgent', async () => {
|
||||
process.env['https_proxy'] = 'http://127.0.0.1:8080'
|
||||
const httpClient = new httpm.HttpClient()
|
||||
const agent: Agent | ProxyAgent = httpClient.getAgentDispatcher('https://some-url')
|
||||
const agent = httpClient.getAgentDispatcher('https://some-url')
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(agent)
|
||||
expect(agent instanceof ProxyAgent).toBe(true)
|
||||
})
|
||||
|
||||
it('proxyAuth is set in tunnel agent when authentication is provided', async () => {
|
||||
const httpClient = new httpm.HttpClient()
|
||||
const agent: Agent | ProxyAgent = httpClient.getAgentDispatcher('https://some-url')
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(agent)
|
||||
expect(agent instanceof Agent).toBe(true)
|
||||
})
|
||||
// it('proxyAuth is set in tunnel agent when authentication is provided', async () => {
|
||||
// const httpClient = new httpm.HttpClient()
|
||||
// const agent: Agent | ProxyAgent = httpClient.getAgentDispatcher('https://some-url')
|
||||
// // eslint-disable-next-line no-console
|
||||
// console.log(agent)
|
||||
// expect(agent instanceof Agent).toBe(true)
|
||||
// })
|
||||
})
|
||||
|
||||
function _clearVars(): void {
|
||||
|
||||
BIN
packages/http-client/actions-http-client-3.0.3.tgz
Normal file
BIN
packages/http-client/actions-http-client-3.0.3.tgz
Normal file
Binary file not shown.
4
packages/http-client/package-lock.json
generated
4
packages/http-client/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@actions/http-client",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.3",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@actions/http-client",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"tunnel": "^0.0.6"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@actions/http-client",
|
||||
"version": "3.0.1",
|
||||
"version": "3.0.3",
|
||||
"description": "Actions Http Client",
|
||||
"keywords": [
|
||||
"github",
|
||||
|
||||
@@ -567,7 +567,7 @@ export class HttpClient {
|
||||
return this._getAgent(parsedUrl)
|
||||
}
|
||||
|
||||
getAgentDispatcher(serverUrl: string): ProxyAgent | Agent {
|
||||
getAgentDispatcher(serverUrl: string): ProxyAgent | undefined {
|
||||
const parsedUrl = new URL(serverUrl)
|
||||
const proxyUrl = pm.getProxyUrl(parsedUrl)
|
||||
const useProxy = proxyUrl && proxyUrl.hostname
|
||||
@@ -575,7 +575,7 @@ export class HttpClient {
|
||||
return this._getProxyAgentDispatcher(parsedUrl, proxyUrl)
|
||||
}
|
||||
else {
|
||||
return this._getAgentDispatcher(parsedUrl)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user