Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,12 @@ function createApp(options = {}) {
app.post("/check", async (req, res) => {
const userUrl = req.body.url;

if (!userUrl) {
return res.status(400).json({ error: "No URL provided" });
if (!userUrl || typeof userUrl !== "string") {
return res.status(400).json({ error: "No URL provided or invalid format" });
}

if (userUrl.length > 2048) {
return res.status(400).json({ error: "URL exceeds maximum length of 2048 characters" });
}

try {
Expand Down