summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rwxr-xr-xhooks/mod.ts5
-rw-r--r--utils/validate_identifier.ts2
3 files changed, 5 insertions, 3 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..802ac1f
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+## TODO
diff --git a/hooks/mod.ts b/hooks/mod.ts
index cc29e43..bef822e 100755
--- a/hooks/mod.ts
+++ b/hooks/mod.ts
@@ -45,7 +45,8 @@ Deno.serve(addr, async (req) => {
if (pathname === "/checkout_ci") {
const { remote, rev, refname } = await req.json();
if (![remote, rev, refname].every(validateIdentifier)) {
- return new Response("invalid request", {
+ logger.log("invalid reqwest\n");
+ return new Response("invalid reqwest >:D\n", {
status: 400,
});
}
@@ -64,7 +65,7 @@ Deno.serve(addr, async (req) => {
});
}
- return new Response("idk what that is bro\n", { status: 404 });
+ return new Response("idk what that is bro :((\n", { status: 404 });
} catch (e) {
logger.error("Uncaught exception", e);
return new Response("womp womp D:\n", { status: 500 });
diff --git a/utils/validate_identifier.ts b/utils/validate_identifier.ts
index c8a5213..0c9242c 100644
--- a/utils/validate_identifier.ts
+++ b/utils/validate_identifier.ts
@@ -1,3 +1,3 @@
export const validateIdentifier = (token: string) => {
- return (/^[a-zA-Z0-9_\-:. ]+$/).test(token) && !token.includes("..");
+ return (/^[a-zA-Z0-9_\-:. \/]+$/).test(token) && !token.includes("..");
};