diff --git a/index.js b/index.js index a559068..0b3cdba 100644 --- a/index.js +++ b/index.js @@ -18,9 +18,15 @@ export const EmptyBodyError = createError( async function fastifyHttpQuery (fastify) { // `addHttpMethod` overrides existing methods, so guard against // registering QUERY more than once when the plugin is loaded twice. + // Fastify 5+ hardcodes QUERY in supportedMethods, so this branch is + // unreachable in the current test environment; the guard is kept for + // future Fastify versions / custom environments where QUERY may not yet + // be registered. + /* c8 ignore start */ if (!fastify.supportedMethods.includes(QUERY_METHOD)) { fastify.addHttpMethod(QUERY_METHOD, { hasBody: true }) } + /* c8 ignore stop */ // Enforce the spec's server requirements before the body is parsed. // https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html diff --git a/package.json b/package.json index a7456d8..29c01e5 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,9 @@ "main": "index.js", "type": "module", "types": "types/index.d.ts", + "engines": { + "node": "^22.13.0 || >=24" + }, "scripts": { "lint": "eslint", "lint:fix": "eslint --fix", @@ -42,10 +45,10 @@ "@fastify/etag": "^6.1.0", "@types/node": "^26.1.1", "c8": "^12.0.0", - "eslint": "^9.17.0", + "eslint": "^10.0.0", "fastify": "^5.0.0", "lefthook": "^2.1.9", - "neostandard": "^0.13.0", + "neostandard": "0.14.0-next.1", "proxyquire": "^2.1.3", "release-it": "^20.2.0", "@release-it/conventional-changelog": "^11.0.1",