mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-15 22:48:00 +02:00
check commit format
This commit is contained in:
@@ -52,6 +52,9 @@ router.post("/:repoId/", async (req, res) => {
|
|||||||
if (!Array.isArray(repoUpdate.terms)) {
|
if (!Array.isArray(repoUpdate.terms)) {
|
||||||
return res.status(500).send({ error: "invalid_terms_format" });
|
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 {
|
try {
|
||||||
const details = await repoUtils.getRepoDetails({
|
const details = await repoUtils.getRepoDetails({
|
||||||
@@ -285,6 +288,9 @@ router.post("/", async (req, res) => {
|
|||||||
if (!Array.isArray(repoConfig.terms)) {
|
if (!Array.isArray(repoConfig.terms)) {
|
||||||
return res.status(500).send({ error: "invalid_terms_format" });
|
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({
|
await repoUtils.getRepoBranches({
|
||||||
repoConfig,
|
repoConfig,
|
||||||
|
|||||||
Reference in New Issue
Block a user