bug fixed
This commit is contained in:
parent
828e8eae2e
commit
94d1bbbfba
|
@ -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`
|
||||
);
|
||||
|
|
Ŝarĝante…
Reference in New Issue