bug fixed

This commit is contained in:
daniel31x13 2023-11-24 12:51:43 -05:00
parent 828e8eae2e
commit 94d1bbbfba

View File

@ -53,7 +53,11 @@ export default async function Index(req: NextApiRequest, res: NextApiResponse) {
.send("File inaccessible.");
}
if (user.username && !whitelistedUsernames?.includes(user.username)) {
if (
user.username &&
!whitelistedUsernames?.includes(user.username) &&
targetUser.id !== user.id
) {
return res
.setHeader("Content-Type", "text/plain")
.status(400)
@ -61,6 +65,8 @@ export default async function Index(req: NextApiRequest, res: NextApiResponse) {
}
}
console.log(queryId);
const { file, contentType, status } = await readFile(
`uploads/avatar/${queryId}.jpg`
);