From d762332ef2ce093a24dcff3a54748435648a4c97 Mon Sep 17 00:00:00 2001 From: tdurieux Date: Tue, 20 Apr 2021 17:52:08 +0200 Subject: [PATCH] check if branch exist --- routes/repository.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/routes/repository.js b/routes/repository.js index bdffeb1..f1151d4 100644 --- a/routes/repository.js +++ b/routes/repository.js @@ -277,6 +277,9 @@ router.post("/", async (req, res) => { repoConfig, token: req.user.accessToken, }); + if (details.branches[repoConfig.branch] == null) { + return res.status(500).send({ error: "invalid_branch" }); + } if (repoConfig.options.mode == "download") { // details.size is in kilobytes if (details.size > config.MAX_REPO_SIZE) {