From dfd299d4697a629f09ef20fc05c6d9e474bd5475 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 15 Aug 2021 15:29:53 +0200 Subject: Improved route parameter validation --- packages/server/src/routes/repo.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'packages/server/src/routes/repo.ts') diff --git a/packages/server/src/routes/repo.ts b/packages/server/src/routes/repo.ts index 32ac9c4..bb70c68 100644 --- a/packages/server/src/routes/repo.ts +++ b/packages/server/src/routes/repo.ts @@ -61,6 +61,11 @@ export default function(fastify: FastifyInstance, opts: FastifyPluginOptions, do fastify.route({ method: "GET", url: "/refs/tags/:tag", + schema: { + params: { + tag: { type: "string" } + } + }, handler: async(req, reply) => { const repository = await Repository.open(opts.config.settings.git_dir, req.params.repo).catch((err: ServerError) => err); -- cgit v1.2.3-18-g5258