|
@@ -646,15 +646,7 @@ app.post("/avatar", async (req, res) => {
|
|
|
res.set(cwh).status(500).json({code: 500, R: "IO"})
|
|
|
return
|
|
|
}
|
|
|
- try{
|
|
|
- if (["image/png", "image/webp", "image/jpeg","image/jpg", "image/bmp"].indexOf((await detectBufferMime(Buffer.from(Object.values(req.body.avatar))))) === -1) {
|
|
|
- res.set(cwh).status(500).json({code: 500, R: "ILLEGAL IMAGE"})
|
|
|
- return;
|
|
|
- }
|
|
|
- }catch(err){
|
|
|
- console.log(err)
|
|
|
- return;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
db.execute("UPDATE user set avatar = ? where uuid = ?", [Buffer.from(Object.values(req.body.avatar)), req.session.uuid], (err, result) => {
|
|
|
if (err) {
|