Prepend http:// to http(s)_proxy env if missing (#1439)

* Prepend http:// to http(s)_proxy env if missing

* Formatting

* Fix linting
This commit is contained in:
Ferenc Hammerl authored and GitHub committed 2023-06-22 11:03:38 +02:00
1 parent 9d8bfe0007
commit 081fb7ff98
2 files changed
+12 -1

No files matched your search

+6
View File
@@ -91,6 +91,12 @@ describe('proxy', () => {
expect(proxyUrl).toBeDefined()
})
it('getProxyUrl returns proxyUrl if http_proxy has no protocol', () => {
process.env['http_proxy'] = 'myproxysvr'
const proxyUrl = pm.getProxyUrl(new URL('http://github.com'))
expect(proxyUrl?.toString()).toBe('http://myproxysvr/')
})
it('checkBypass returns true if host as no_proxy list', () => {
process.env['no_proxy'] = 'myserver'
const bypass = pm.checkBypass(new URL('https://myserver'))