mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-12 18:32:44 +00:00
check commit format
This commit is contained in:
@@ -52,6 +52,9 @@ router.post("/:repoId/", async (req, res) => {
|
||||
if (!Array.isArray(repoUpdate.terms)) {
|
||||
return res.status(500).send({ error: "invalid_terms_format" });
|
||||
}
|
||||
if (!/^[a-f0-9]+$/.test(repoUpdate.commit)) {
|
||||
return res.status(500).send({ error: "invalid_commit_format" });
|
||||
}
|
||||
|
||||
try {
|
||||
const details = await repoUtils.getRepoDetails({
|
||||
@@ -285,6 +288,9 @@ router.post("/", async (req, res) => {
|
||||
if (!Array.isArray(repoConfig.terms)) {
|
||||
return res.status(500).send({ error: "invalid_terms_format" });
|
||||
}
|
||||
if (!/^[a-f0-9]+$/.test(repoConfig.commit)) {
|
||||
return res.status(500).send({ error: "invalid_commit_format" });
|
||||
}
|
||||
|
||||
await repoUtils.getRepoBranches({
|
||||
repoConfig,
|
||||
|
||||
Reference in New Issue
Block a user