Skip to content

Commit f31d3f9

Browse files
don't use EnvHttpProxyAgent by default
1 parent 3b7cd3b commit f31d3f9

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

index-fetch.js

-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
'use strict'
22

3-
const Dispatcher = require('./lib/dispatcher/dispatcher')
4-
const api = require('./lib/api')
5-
Object.assign(Dispatcher.prototype, api)
6-
73
const fetchImpl = require('./lib/web/fetch').fetch
84

95
module.exports.fetch = function fetch (resource, init = undefined) {

lib/global.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
// this version number must be increased to avoid conflicts.
55
const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
66
const { InvalidArgumentError } = require('./core/errors')
7-
const EnvHttpProxyAgent = require('./dispatcher/env-http-proxy-agent')
7+
const Agent = require('./dispatcher/agent')
88

99
if (getGlobalDispatcher() === undefined) {
10-
setGlobalDispatcher(new EnvHttpProxyAgent())
10+
setGlobalDispatcher(new Agent())
1111
}
1212

1313
function setGlobalDispatcher (agent) {

test/node-fetch/main.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const {
1717
FormData,
1818
Response,
1919
setGlobalDispatcher,
20-
EnvHttpProxyAgent
20+
Agent
2121
} = require('../../index.js')
2222
const HeadersOrig = require('../../lib/web/fetch/headers.js').Headers
2323
const ResponseOrig = require('../../lib/web/fetch/response.js').Response
@@ -34,7 +34,7 @@ describe('node-fetch', () => {
3434

3535
before(async () => {
3636
await local.start()
37-
setGlobalDispatcher(new EnvHttpProxyAgent({
37+
setGlobalDispatcher(new Agent({
3838
connect: {
3939
rejectUnauthorized: false
4040
}

test/node-test/debug.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ test('debug#fetch', async t => {
5353
process.execPath,
5454
[join(__dirname, '../fixtures/fetch.js')],
5555
{
56-
env: Object.assign({}, process.env, { NODE_DEBUG: 'fetch', NO_PROXY: '*' })
56+
env: Object.assign({}, process.env, { NODE_DEBUG: 'fetch' })
5757
}
5858
)
5959
const chunks = []

0 commit comments

Comments
 (0)