refactored how avatars are being handled

This commit is contained in:
daniel31x13
2023-10-28 00:45:14 -04:00
parent f9eedadb9f
commit cdcfabec0b
21 changed files with 55 additions and 85 deletions
+5 -4
View File
@@ -13,7 +13,7 @@ export default async function Index(req: NextApiRequest, res: NextApiResponse) {
if (!userId || !username)
return res
.setHeader("Content-Type", "text/html")
.setHeader("Content-Type", "text/plain")
.status(401)
.send("You must be logged in.");
else if (session?.user?.isSubscriber === false)
@@ -24,7 +24,7 @@ export default async function Index(req: NextApiRequest, res: NextApiResponse) {
if (!queryId)
return res
.setHeader("Content-Type", "text/html")
.setHeader("Content-Type", "text/plain")
.status(401)
.send("Invalid parameters.");
@@ -44,8 +44,9 @@ export default async function Index(req: NextApiRequest, res: NextApiResponse) {
if (targetUser?.isPrivate && !whitelistedUsernames?.includes(username)) {
return res
.setHeader("Content-Type", "text/html")
.send("This profile is private.");
.setHeader("Content-Type", "text/plain")
.status(400)
.send("File not found.");
}
}