diff --git a/package.json b/package.json index 395f311..ffd79cc 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "into-stream": "6.0.0", "license-checker": "25.0.1", "node-abort-controller": "3.1.1", - "proxy": "1.0.2", + "proxy": "2.2.0", "rimraf": "6.0.1", "stoppable": "1.1.0", "tap": "21.0.1", diff --git a/test/acceptance/proxy.test.ts b/test/acceptance/proxy.test.ts index 3e049f8..8091c85 100644 --- a/test/acceptance/proxy.test.ts +++ b/test/acceptance/proxy.test.ts @@ -132,9 +132,7 @@ test('http basic authentication', async t => { res.end(JSON.stringify({ hello: 'world' })) }) - proxy.authenticate = function (req, fn): void { - fn(null, req.headers['proxy-authorization'] === `Basic ${Buffer.from('hello:world').toString('base64')}`) - } + proxy.authenticate = (req) => req.headers['proxy-authorization'] === `Basic ${Buffer.from('hello:world').toString('base64')}` const client = new TestClient({ node: `http://${(server.address() as AddressInfo).address}:${(server.address() as AddressInfo).port}`, @@ -158,9 +156,7 @@ test('https basic authentication', async t => { res.end(JSON.stringify({ hello: 'world' })) }) - proxy.authenticate = function (req, fn): void { - fn(null, req.headers['proxy-authorization'] === `Basic ${Buffer.from('hello:world').toString('base64')}`) - } + proxy.authenticate = (req) => req.headers['proxy-authorization'] === `Basic ${Buffer.from('hello:world').toString('base64')}` const client = new TestClient({ node: `https://${(server.address() as AddressInfo).address}:${(server.address() as AddressInfo).port}`, diff --git a/test/utils/buildProxy.ts b/test/utils/buildProxy.ts index 37f58d5..68813f0 100644 --- a/test/utils/buildProxy.ts +++ b/test/utils/buildProxy.ts @@ -18,7 +18,7 @@ */ // @ts-ignore -import proxy from 'proxy' +import { createProxy as proxy } from 'proxy' import { readFileSync } from 'fs' import { join } from 'path' import * as http from 'http'