Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Loading