Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
leafac committed Jan 9, 2025
1 parent 90a7520 commit 143a3ca
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions source/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ application.server?.push({
) => {
if (
typeof request.body.title !== "string" ||
request.body.title === "" ||
request.body.title.trim() === "" ||
request.body.title.length > 200
)
throw "validation";
Expand Down Expand Up @@ -1115,16 +1115,18 @@ application.server?.push({
if (
typeof request.body.title !== "string" ||
request.body.title.trim() === "" ||
request.body.title.length > 200 ||
typeof request.body.icon !== "string" ||
(request.body.icon.trim() !== "" &&
(() => {
try {
new URL(request.body.icon);
return false;
} catch {
return true;
}
})())
(request.body.icon.length > 200 ||
(() => {
try {
new URL(request.body.icon);
return false;
} catch {
return true;
}
})()))
)
throw "validation";
application.database.run(
Expand Down

0 comments on commit 143a3ca

Please sign in to comment.