Skip to content

Commit

Permalink
failing test for nodejs#1623
Browse files Browse the repository at this point in the history
  • Loading branch information
protometa committed Aug 29, 2022
1 parent 97bde3a commit 9256df5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/proxy-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ test('use proxy-agent with setGlobalDispatcher', async (t) => {
})

test('ProxyAgent correctly sends headers when using fetch - #1355', { skip: nodeMajor < 16 }, async (t) => {
t.plan(1)
t.plan(2)
const defaultDispatcher = getGlobalDispatcher()

const server = await buildServer()
Expand All @@ -266,6 +266,15 @@ test('ProxyAgent correctly sends headers when using fetch - #1355', { skip: node
'accept-encoding': 'gzip, deflate'
}

const expectedProxyHeaders = {
host: `localhost:${proxy.address().port}`,
connection: 'keep-alive'
}

proxy.on('connect', (req, res) => {
t.same(req.headers, expectedProxyHeaders)
})

server.on('request', (req, res) => {
t.same(req.headers, expectedHeaders)
res.end('goodbye')
Expand Down

0 comments on commit 9256df5

Please sign in to comment.