Skip to content

Commit

Permalink
fix(backend): 🐛 modify the check for domain name
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepaPrasanna committed May 16, 2024
1 parent 16ccc9c commit 82f578f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/controllers/url.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ export async function shortenUrl(req: Request, res: Response) {
}
const { url } = matchedData(req);

const hostname = new URL(url).hostname;

if (hostname === process.env.HOSTNAME) {
if (url.includes("teenyurl.in")) {
return res.status(422).send({ message: "Failed! Domain name not allowed" });
}

Expand Down

0 comments on commit 82f578f

Please sign in to comment.