Skip to content

Commit 1d1f8fa

Browse files
authored
test: fix for node 20 (#254)
Signed-off-by: Matteo Collina <[email protected]>
1 parent 769ddfc commit 1d1f8fa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

test/hooks.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ test('Should not hijack reply for a normal http request in the internal onError
276276
const httpClient = net.createConnection({ port }, () => {
277277
t.teardown(httpClient.destroy.bind(httpClient))
278278

279-
httpClient.write('GET / HTTP/1.1\r\n\r\n')
279+
httpClient.write('GET / HTTP/1.1\r\nHOST: localhost\r\n\r\n')
280280
httpClient.once('data', data => {
281281
t.match(data.toString(), /Fail/i)
282282
})
@@ -352,7 +352,7 @@ test('Should not hijack reply for an normal request to a websocket route that is
352352

353353
const httpClient = net.createConnection({ port }, () => {
354354
t.teardown(httpClient.destroy.bind(httpClient))
355-
httpClient.write('GET /echo HTTP/1.1\r\n\r\n')
355+
httpClient.write('GET /echo HTTP/1.1\r\nHOST: localhost\r\n\r\n')
356356
httpClient.once('data', data => {
357357
t.match(data.toString(), /not found/i)
358358
})

test/router.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ test('Should invoke the correct handler depending on the headers', t => {
306306
const port = fastify.server.address().port
307307

308308
const httpClient = net.createConnection({ port }, () => {
309-
httpClient.write('GET / HTTP/1.1\r\n\r\n')
309+
httpClient.write('GET / HTTP/1.1\r\nHOST: localhost\r\n\r\n')
310310
httpClient.once('data', data => {
311311
t.match(data.toString(), /hi from handler/i)
312312
httpClient.end()

0 commit comments

Comments
 (0)