Implicitly bypass localhost when proxying requests.
https://chromium-review.googlesource.com/c/chromium/src/+/1303626
This commit is contained in:
parent
03d499bf34
commit
d2c0f9f754
1 changed files with 14 additions and 1 deletions
|
@ -562,6 +562,19 @@ describe('session module', () => {
|
|||
|
||||
it('allows configuring proxy settings', (done) => {
|
||||
const config = { proxyRules: 'http=myproxy:80' }
|
||||
customSession.setProxy(config, () => {
|
||||
customSession.resolveProxy('http://example.com/', (proxy) => {
|
||||
assert.strictEqual(proxy, 'PROXY myproxy:80')
|
||||
done()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('allows removing the implicit bypass rules for localhost', (done) => {
|
||||
const config = {
|
||||
proxyRules: 'http=myproxy:80',
|
||||
proxyBypassRules: '<-loopback>'
|
||||
}
|
||||
customSession.setProxy(config, () => {
|
||||
customSession.resolveProxy('http://localhost', (proxy) => {
|
||||
assert.strictEqual(proxy, 'PROXY myproxy:80')
|
||||
|
@ -599,7 +612,7 @@ describe('session module', () => {
|
|||
proxyBypassRules: '<local>'
|
||||
}
|
||||
customSession.setProxy(config, () => {
|
||||
customSession.resolveProxy('http://localhost', (proxy) => {
|
||||
customSession.resolveProxy('http://example/', (proxy) => {
|
||||
assert.strictEqual(proxy, 'DIRECT')
|
||||
done()
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue