diff --git a/README.md b/README.md index ccb2ed91..6c6f18e7 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ socket server by using `querystring.escape(socketPath)` as the hostname. This i for http2 nor undici. To illustrate: ```js -const socketPath = require('querystring').escape('/run/http-daemon.socket') +const socketPath = require('node:querystring').escape('/run/http-daemon.socket') proxy.register(require('@fastify/reply-from'), { base: 'unix+http://${socketPath}/' }); diff --git a/index.js b/index.js index 1bec551a..b8506271 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ const fp = require('fastify-plugin') const { lru } = require('tiny-lru') const querystring = require('fast-querystring') -const Stream = require('stream') +const Stream = require('node:stream') const buildRequest = require('./lib/request') const { filterPseudoHeaders, diff --git a/lib/request.js b/lib/request.js index c1d10122..2e3e7dc5 100644 --- a/lib/request.js +++ b/lib/request.js @@ -1,12 +1,12 @@ 'use strict' -const http = require('http') -const https = require('https') -const querystring = require('querystring') +const http = require('node:http') +const https = require('node:https') +const querystring = require('node:querystring') const eos = require('end-of-stream') const pump = require('pump') const undici = require('undici') const { stripHttp1ConnectionHeaders } = require('./utils') -const http2 = require('http2') +const http2 = require('node:http2') const { TimeoutError, diff --git a/test/async-route-handler.test.js b/test/async-route-handler.test.js index b1df5fba..018b4dd4 100644 --- a/test/async-route-handler.test.js +++ b/test/async-route-handler.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/base-get.test.js b/test/base-get.test.js index c7653eab..aa87ffc1 100644 --- a/test/base-get.test.js +++ b/test/base-get.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/base-querystring.test.js b/test/base-querystring.test.js index c8bfc08a..6e7a88b9 100644 --- a/test/base-querystring.test.js +++ b/test/base-querystring.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/core-with-path-in-base.test.js b/test/core-with-path-in-base.test.js index caa18c98..d57a4a9f 100644 --- a/test/core-with-path-in-base.test.js +++ b/test/core-with-path-in-base.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/custom-undici-instance.test.js b/test/custom-undici-instance.test.js index 509b432c..47f444fe 100644 --- a/test/custom-undici-instance.test.js +++ b/test/custom-undici-instance.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const undici = require('undici') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const From = require('..') diff --git a/test/disable-request-logging.test.js b/test/disable-request-logging.test.js index f650ca68..865ab6a6 100644 --- a/test/disable-request-logging.test.js +++ b/test/disable-request-logging.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const split = require('split2') diff --git a/test/fastify-multipart-incompatibility.test.js b/test/fastify-multipart-incompatibility.test.js index fa731f81..022c33e6 100644 --- a/test/fastify-multipart-incompatibility.test.js +++ b/test/fastify-multipart-incompatibility.test.js @@ -1,12 +1,12 @@ 'use strict' -const fs = require('fs') -const path = require('path') +const fs = require('node:fs') +const path = require('node:path') const t = require('tap') const Fastify = require('fastify') const From = require('..') const Multipart = require('@fastify/multipart') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const FormData = require('form-data') diff --git a/test/full-get-test.test.js b/test/full-get-test.test.js index b8d0e078..7b5a48b9 100644 --- a/test/full-get-test.test.js +++ b/test/full-get-test.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/full-https-get.test.js b/test/full-https-get.test.js index 7fa5d9fa..45f8893e 100644 --- a/test/full-https-get.test.js +++ b/test/full-https-get.test.js @@ -3,10 +3,10 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const https = require('https') +const https = require('node:https') const get = require('simple-get').concat -const fs = require('fs') -const path = require('path') +const fs = require('node:fs') +const path = require('node:path') const certs = { key: fs.readFileSync(path.join(__dirname, 'fixtures', 'fastify.key')), cert: fs.readFileSync(path.join(__dirname, 'fixtures', 'fastify.cert')) diff --git a/test/full-post-extended-content-type.test.js b/test/full-post-extended-content-type.test.js index 1ad5c30b..ba62cc61 100644 --- a/test/full-post-extended-content-type.test.js +++ b/test/full-post-extended-content-type.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get') const instance = Fastify() diff --git a/test/full-post-stream-core.test.js b/test/full-post-stream-core.test.js index a476b60a..2e6936f8 100644 --- a/test/full-post-stream-core.test.js +++ b/test/full-post-stream-core.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/full-post-stream.test.js b/test/full-post-stream.test.js index 333c8766..7c0274aa 100644 --- a/test/full-post-stream.test.js +++ b/test/full-post-stream.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/full-post.test.js b/test/full-post.test.js index 85fd48cb..6927daee 100644 --- a/test/full-post.test.js +++ b/test/full-post.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/full-querystring-rewrite-option-complex.test.js b/test/full-querystring-rewrite-option-complex.test.js index feeada07..47715d32 100644 --- a/test/full-querystring-rewrite-option-complex.test.js +++ b/test/full-querystring-rewrite-option-complex.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/full-querystring-rewrite-option-function.test.js b/test/full-querystring-rewrite-option-function.test.js index 6c48a7a1..8428b223 100644 --- a/test/full-querystring-rewrite-option-function.test.js +++ b/test/full-querystring-rewrite-option-function.test.js @@ -3,9 +3,9 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat -const querystring = require('querystring') +const querystring = require('node:querystring') const instance = Fastify() diff --git a/test/full-querystring-rewrite-option.test.js b/test/full-querystring-rewrite-option.test.js index e640eac9..de08ae1b 100644 --- a/test/full-querystring-rewrite-option.test.js +++ b/test/full-querystring-rewrite-option.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/full-querystring-rewrite-string.test.js b/test/full-querystring-rewrite-string.test.js index f28ddf60..05ccd442 100644 --- a/test/full-querystring-rewrite-string.test.js +++ b/test/full-querystring-rewrite-string.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/full-querystring-rewrite.test.js b/test/full-querystring-rewrite.test.js index 8d0fa542..0e7f574e 100644 --- a/test/full-querystring-rewrite.test.js +++ b/test/full-querystring-rewrite.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/full-querystring.test.js b/test/full-querystring.test.js index 8d0fa542..0e7f574e 100644 --- a/test/full-querystring.test.js +++ b/test/full-querystring.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/full-rewrite-body-content-type.test.js b/test/full-rewrite-body-content-type.test.js index cec3eadd..99c00760 100644 --- a/test/full-rewrite-body-content-type.test.js +++ b/test/full-rewrite-body-content-type.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const msgpack = require('msgpack5')() diff --git a/test/full-rewrite-body-http.test.js b/test/full-rewrite-body-http.test.js index f68c695f..2b6cd542 100644 --- a/test/full-rewrite-body-http.test.js +++ b/test/full-rewrite-body-http.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/full-rewrite-body-to-empty-string.test.js b/test/full-rewrite-body-to-empty-string.test.js index 51a6239c..7ac9ce7f 100644 --- a/test/full-rewrite-body-to-empty-string.test.js +++ b/test/full-rewrite-body-to-empty-string.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/full-rewrite-body-to-null.test.js b/test/full-rewrite-body-to-null.test.js index bc52e4f8..7ecf0f0a 100644 --- a/test/full-rewrite-body-to-null.test.js +++ b/test/full-rewrite-body-to-null.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/full-rewrite-body.test.js b/test/full-rewrite-body.test.js index 9d616ed9..c28f0786 100644 --- a/test/full-rewrite-body.test.js +++ b/test/full-rewrite-body.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/get-upstream-http.test.js b/test/get-upstream-http.test.js index 99403ad2..96b8fac4 100644 --- a/test/get-upstream-http.test.js +++ b/test/get-upstream-http.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/get-upstream-type.test.js b/test/get-upstream-type.test.js index 3d9deecd..eb7f36f6 100644 --- a/test/get-upstream-type.test.js +++ b/test/get-upstream-type.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/get-upstream-undici.test.js b/test/get-upstream-undici.test.js index 1d1d676f..28440940 100644 --- a/test/get-upstream-undici.test.js +++ b/test/get-upstream-undici.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/get-with-body.test.js b/test/get-with-body.test.js index 000ea724..d5a0d798 100644 --- a/test/get-with-body.test.js +++ b/test/get-with-body.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/head-with-body.test.js b/test/head-with-body.test.js index 6e8c15f1..f3d6d052 100644 --- a/test/head-with-body.test.js +++ b/test/head-with-body.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const semver = require('semver') diff --git a/test/http-agents.test.js b/test/http-agents.test.js index b95cdc48..8141f493 100644 --- a/test/http-agents.test.js +++ b/test/http-agents.test.js @@ -3,8 +3,8 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') -const https = require('https') +const http = require('node:http') +const https = require('node:https') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/http-global-agent.test.js b/test/http-global-agent.test.js index 55d381c5..44cf339e 100644 --- a/test/http-global-agent.test.js +++ b/test/http-global-agent.test.js @@ -3,7 +3,7 @@ const { test } = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat test('http global agent is used, but not destroyed', async (t) => { diff --git a/test/http-retry.test.js b/test/http-retry.test.js index 7eaf0917..48ec5dae 100644 --- a/test/http-retry.test.js +++ b/test/http-retry.test.js @@ -7,7 +7,7 @@ const { test } = require('tap') let retryNum = 1 -const target = require('http').createServer(function (req, res) { +const target = require('node:http').createServer(function (req, res) { if (retryNum % 2 !== 0) { req.socket.destroy() } else { diff --git a/test/http2-http2.test.js b/test/http2-http2.test.js index 451d7704..80aa8b48 100644 --- a/test/http2-http2.test.js +++ b/test/http2-http2.test.js @@ -4,8 +4,8 @@ const h2url = require('h2url') const t = require('tap') const Fastify = require('fastify') const From = require('..') -const fs = require('fs') -const path = require('path') +const fs = require('node:fs') +const path = require('node:path') const certs = { key: fs.readFileSync(path.join(__dirname, 'fixtures', 'fastify.key')), cert: fs.readFileSync(path.join(__dirname, 'fixtures', 'fastify.cert')) diff --git a/test/http2-https.test.js b/test/http2-https.test.js index 946b6da8..98789f3b 100644 --- a/test/http2-https.test.js +++ b/test/http2-https.test.js @@ -5,8 +5,8 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') const got = require('got') -const fs = require('fs') -const path = require('path') +const fs = require('node:fs') +const path = require('node:path') const certs = { allowHTTP1: true, // fallback support for HTTP1 key: fs.readFileSync(path.join(__dirname, 'fixtures', 'fastify.key')), diff --git a/test/https-agents.test.js b/test/https-agents.test.js index 43c5adfa..2aec3363 100644 --- a/test/https-agents.test.js +++ b/test/https-agents.test.js @@ -3,12 +3,12 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') -const https = require('https') +const http = require('node:http') +const https = require('node:https') const get = require('simple-get').concat -const fs = require('fs') -const path = require('path') +const fs = require('node:fs') +const path = require('node:path') const certs = { key: fs.readFileSync(path.join(__dirname, 'fixtures', 'fastify.key')), cert: fs.readFileSync(path.join(__dirname, 'fixtures', 'fastify.cert')) diff --git a/test/https-global-agent.test.js b/test/https-global-agent.test.js index d65d3d25..ac207226 100644 --- a/test/https-global-agent.test.js +++ b/test/https-global-agent.test.js @@ -3,11 +3,11 @@ const { test } = require('tap') const Fastify = require('fastify') const From = require('..') -const https = require('https') +const https = require('node:https') const get = require('simple-get').concat -const fs = require('fs') -const path = require('path') +const fs = require('node:fs') +const path = require('node:path') const certs = { key: fs.readFileSync(path.join(__dirname, 'fixtures', 'fastify.key')), cert: fs.readFileSync(path.join(__dirname, 'fixtures', 'fastify.cert')) diff --git a/test/method.test.js b/test/method.test.js index e7562072..cd0906d9 100644 --- a/test/method.test.js +++ b/test/method.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/modifyCoreObjects-false.test.js b/test/modifyCoreObjects-false.test.js index fafc8808..237edfdb 100644 --- a/test/modifyCoreObjects-false.test.js +++ b/test/modifyCoreObjects-false.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify({ modifyCoreObjects: false }) diff --git a/test/no-body-opts-with-get.test.js b/test/no-body-opts-with-get.test.js index 298ea39d..d611e9ac 100644 --- a/test/no-body-opts-with-get.test.js +++ b/test/no-body-opts-with-get.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/no-body-opts-with-head.test.js b/test/no-body-opts-with-head.test.js index 7d374a7e..bd2c4a70 100644 --- a/test/no-body-opts-with-head.test.js +++ b/test/no-body-opts-with-head.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/no-stream-body-option.test.js b/test/no-stream-body-option.test.js index 0f03d671..d4c575d2 100644 --- a/test/no-stream-body-option.test.js +++ b/test/no-stream-body-option.test.js @@ -3,9 +3,9 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat -const Readable = require('stream').Readable +const Readable = require('node:stream').Readable const instance = Fastify() instance.register(From) diff --git a/test/onResponse.test.js b/test/onResponse.test.js index 710a1200..1f5bd18b 100644 --- a/test/onResponse.test.js +++ b/test/onResponse.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/padded-body.test.js b/test/padded-body.test.js index 18a0cc67..0ce4888f 100644 --- a/test/padded-body.test.js +++ b/test/padded-body.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/post-formbody.test.js b/test/post-formbody.test.js index 7ddf4713..d7a2b65e 100644 --- a/test/post-formbody.test.js +++ b/test/post-formbody.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/post-plain-text.test.js b/test/post-plain-text.test.js index 9da16cf1..74d0d41b 100644 --- a/test/post-plain-text.test.js +++ b/test/post-plain-text.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/post-with-custom-encoded-contenttype.test.js b/test/post-with-custom-encoded-contenttype.test.js index 9b16a4ff..aeed2512 100644 --- a/test/post-with-custom-encoded-contenttype.test.js +++ b/test/post-with-custom-encoded-contenttype.test.js @@ -3,9 +3,9 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat -const { parse } = require('querystring') +const { parse } = require('node:querystring') const instance = Fastify() instance.register(From, { diff --git a/test/post-with-octet-stream.test.js b/test/post-with-octet-stream.test.js index 3bb08832..1d2f1269 100644 --- a/test/post-with-octet-stream.test.js +++ b/test/post-with-octet-stream.test.js @@ -3,9 +3,9 @@ const test = require('tap').test const Fastify = require('fastify') const From = require('../index') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat -const { parse } = require('querystring') +const { parse } = require('node:querystring') test('with explicitly set content-type application/octet-stream', t => { const instance = Fastify() diff --git a/test/retry-on-503.test.js b/test/retry-on-503.test.js index 67e44fd6..8d079b38 100644 --- a/test/retry-on-503.test.js +++ b/test/retry-on-503.test.js @@ -3,7 +3,7 @@ const { test } = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const got = require('got') function createTargetServer (withRetryAfterHeader, stopAfter = 1) { diff --git a/test/rewrite-headers-type.test.js b/test/rewrite-headers-type.test.js index 530175a8..e44316d4 100644 --- a/test/rewrite-headers-type.test.js +++ b/test/rewrite-headers-type.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/rewrite-headers.test.js b/test/rewrite-headers.test.js index 1e858fc9..048dfc91 100644 --- a/test/rewrite-headers.test.js +++ b/test/rewrite-headers.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/rewrite-request-headers-type.test.js b/test/rewrite-request-headers-type.test.js index 24d52a9f..1b4e6a57 100644 --- a/test/rewrite-request-headers-type.test.js +++ b/test/rewrite-request-headers-type.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/rewrite-request-headers.test.js b/test/rewrite-request-headers.test.js index 93041697..76f1ce46 100644 --- a/test/rewrite-request-headers.test.js +++ b/test/rewrite-request-headers.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/transform-body.test.js b/test/transform-body.test.js index 842e874f..0a1e62aa 100644 --- a/test/transform-body.test.js +++ b/test/transform-body.test.js @@ -3,9 +3,9 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat -const Transform = require('stream').Transform +const Transform = require('node:stream').Transform const instance = Fastify() instance.register(From) diff --git a/test/undici-agent.test.js b/test/undici-agent.test.js index 019696b0..85b64072 100644 --- a/test/undici-agent.test.js +++ b/test/undici-agent.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const proxyquire = require('proxyquire') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const undici = require('undici') const { getUndiciOptions } = require('../lib/request') diff --git a/test/undici-body.test.js b/test/undici-body.test.js index fe75a98a..760f0df4 100644 --- a/test/undici-body.test.js +++ b/test/undici-body.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/undici-connect-timeout.test.js b/test/undici-connect-timeout.test.js index 1d516638..47100d29 100644 --- a/test/undici-connect-timeout.test.js +++ b/test/undici-connect-timeout.test.js @@ -1,8 +1,8 @@ 'use strict' const t = require('tap') -const http = require('http') -const net = require('net') +const http = require('node:http') +const net = require('node:net') const Fastify = require('fastify') const From = require('..') const got = require('got') diff --git a/test/undici-global-agent.test.js b/test/undici-global-agent.test.js index 22fbe46e..c74d4433 100644 --- a/test/undici-global-agent.test.js +++ b/test/undici-global-agent.test.js @@ -2,7 +2,7 @@ const { test } = require('tap') const Fastify = require('fastify') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const undici = require('undici') const From = require('..') diff --git a/test/undici-options.test.js b/test/undici-options.test.js index 86ef6cf8..8f610498 100644 --- a/test/undici-options.test.js +++ b/test/undici-options.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const proxyquire = require('proxyquire') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const undici = require('undici') const { getUndiciOptions } = require('../lib/request') diff --git a/test/undici-retry.test.js b/test/undici-retry.test.js index 519799de..3206d639 100644 --- a/test/undici-retry.test.js +++ b/test/undici-retry.test.js @@ -7,7 +7,7 @@ const { test } = require('tap') let retryNum = 1 -const target = require('http').createServer(function (req, res) { +const target = require('node:http').createServer(function (req, res) { if (retryNum % 2 !== 0) { req.socket.destroy() } else { diff --git a/test/undici-timeout-body-partial.test.js b/test/undici-timeout-body-partial.test.js index 500c031f..195319d7 100644 --- a/test/undici-timeout-body-partial.test.js +++ b/test/undici-timeout-body-partial.test.js @@ -1,7 +1,7 @@ 'use strict' const t = require('tap') -const http = require('http') +const http = require('node:http') const Fastify = require('fastify') const From = require('..') const got = require('got') diff --git a/test/undici-timeout-body.test.js b/test/undici-timeout-body.test.js index 0356dac7..1faf8413 100644 --- a/test/undici-timeout-body.test.js +++ b/test/undici-timeout-body.test.js @@ -1,7 +1,7 @@ 'use strict' const t = require('tap') -const http = require('http') +const http = require('node:http') const Fastify = require('fastify') const From = require('..') const got = require('got') diff --git a/test/undici-with-path-in-base.test.js b/test/undici-with-path-in-base.test.js index 42e548a9..ba0632cd 100644 --- a/test/undici-with-path-in-base.test.js +++ b/test/undici-with-path-in-base.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/undici.test.js b/test/undici.test.js index 32b80f83..0266f56e 100644 --- a/test/undici.test.js +++ b/test/undici.test.js @@ -3,7 +3,7 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const http = require('http') +const http = require('node:http') const get = require('simple-get').concat const instance = Fastify() diff --git a/test/unix-http-undici-from.test.js b/test/unix-http-undici-from.test.js index 9d6460c1..daee46f8 100644 --- a/test/unix-http-undici-from.test.js +++ b/test/unix-http-undici-from.test.js @@ -3,9 +3,9 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const fs = require('fs') -const querystring = require('querystring') -const http = require('http') +const fs = require('node:fs') +const querystring = require('node:querystring') +const http = require('node:http') const get = require('simple-get').concat if (process.platform === 'win32') { diff --git a/test/unix-http-undici.test.js b/test/unix-http-undici.test.js index c46e945c..f80769a4 100644 --- a/test/unix-http-undici.test.js +++ b/test/unix-http-undici.test.js @@ -3,9 +3,9 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const fs = require('fs') -const querystring = require('querystring') -const http = require('http') +const fs = require('node:fs') +const querystring = require('node:querystring') +const http = require('node:http') const get = require('simple-get').concat if (process.platform === 'win32') { diff --git a/test/unix-http.test.js b/test/unix-http.test.js index 12879524..74a8a2d3 100644 --- a/test/unix-http.test.js +++ b/test/unix-http.test.js @@ -3,9 +3,9 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const fs = require('fs') -const querystring = require('querystring') -const http = require('http') +const fs = require('node:fs') +const querystring = require('node:querystring') +const http = require('node:http') const get = require('simple-get').concat if (process.platform === 'win32') { diff --git a/test/unix-https-undici.test.js b/test/unix-https-undici.test.js index b9faf0eb..398f160a 100644 --- a/test/unix-https-undici.test.js +++ b/test/unix-https-undici.test.js @@ -3,11 +3,11 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const https = require('https') +const https = require('node:https') const get = require('simple-get').concat -const fs = require('fs') -const querystring = require('querystring') -const path = require('path') +const fs = require('node:fs') +const querystring = require('node:querystring') +const path = require('node:path') const certs = { key: fs.readFileSync(path.join(__dirname, 'fixtures', 'fastify.key')), cert: fs.readFileSync(path.join(__dirname, 'fixtures', 'fastify.cert')) diff --git a/test/unix-https.test.js b/test/unix-https.test.js index 810e5482..4a00bb3d 100644 --- a/test/unix-https.test.js +++ b/test/unix-https.test.js @@ -3,11 +3,11 @@ const t = require('tap') const Fastify = require('fastify') const From = require('..') -const https = require('https') +const https = require('node:https') const get = require('simple-get').concat -const fs = require('fs') -const querystring = require('querystring') -const path = require('path') +const fs = require('node:fs') +const querystring = require('node:querystring') +const path = require('node:path') const certs = { key: fs.readFileSync(path.join(__dirname, 'fixtures', 'fastify.key')), cert: fs.readFileSync(path.join(__dirname, 'fixtures', 'fastify.cert'))