From 8f69d9f0d540eecd11f5d67ab2545909c994d183 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Wed, 11 Dec 2024 11:09:16 +0100 Subject: [PATCH] Add content-type parser to Fastify Signed-off-by: Matteo Collina --- javascript/fastify/app.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/javascript/fastify/app.js b/javascript/fastify/app.js index e05c62f3149..4aeac34c724 100644 --- a/javascript/fastify/app.js +++ b/javascript/fastify/app.js @@ -11,6 +11,11 @@ app.get('/user/:id', function (request, reply) { reply.send(request.params.id); }); +app.addContentTypeParser('application/x-www-form-urlencoded', function (req, body, done) { + // The incoming request in the benchmark is empty anyway + done(); +}); + app.post('/user', function (request, reply) { reply.send(); });