mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-03 14:43:17 +08:00
Handle Encoded URL for Proxy Username and Password in HTTP Client (#1782)
* uri-decode-fix Signed-off-by: Yu <yu.yang@anz.com> * http-client URLdecode fix Signed-off-by: Yu <yu.yang@anz.com> * http-client URLdecode test typo fix Signed-off-by: Yu <yu.yang@anz.com> --------- Signed-off-by: Yu <yu.yang@anz.com>
This commit is contained in:
@@ -307,6 +307,18 @@ describe('proxy', () => {
|
||||
console.log(agent)
|
||||
expect(agent instanceof ProxyAgent).toBe(true)
|
||||
})
|
||||
|
||||
it('proxyAuth is set in tunnel agent when authentication is provided with URIencoding', async () => {
|
||||
process.env['https_proxy'] =
|
||||
'http://user%40github.com:p%40ssword@127.0.0.1:8080'
|
||||
const httpClient = new httpm.HttpClient()
|
||||
const agent: any = httpClient.getAgent('https://some-url')
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(agent)
|
||||
expect(agent.proxyOptions.host).toBe('127.0.0.1')
|
||||
expect(agent.proxyOptions.port).toBe('8080')
|
||||
expect(agent.proxyOptions.proxyAuth).toBe('user@github.com:p@ssword')
|
||||
})
|
||||
})
|
||||
|
||||
function _clearVars(): void {
|
||||
|
||||
Reference in New Issue
Block a user