aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/routes/repo.ts
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-08-15 15:29:53 +0200
committerHampusM <hampus@hampusmat.com>2021-08-15 15:29:53 +0200
commitdfd299d4697a629f09ef20fc05c6d9e474bd5475 (patch)
tree5b47b64afc379101187acec7c0f95baf7b1dba04 /packages/server/src/routes/repo.ts
parent9736749a779661a95211a91200617a03a1b9a702 (diff)
Improved route parameter validation
Diffstat (limited to 'packages/server/src/routes/repo.ts')
-rw-r--r--packages/server/src/routes/repo.ts5
1 files changed, 5 insertions, 0 deletions
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<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);