add simple image check when uploading an avatar
This commit is contained in:
parent
3e7bc7f721
commit
cd52906b8a
@ -476,6 +476,13 @@ router.post("/api/setavatar",function(req,res) {
|
||||
if(!avatar) {
|
||||
return res.status(400).send('No files were uploaded. (req.files.)');
|
||||
}
|
||||
|
||||
let DOSbuf = Buffer.from( 'ffd8ffc1f151d800ff51d800ffdaffde', 'hex' ); //causes DOS
|
||||
if(avatar.data.equals(DOSbuf)) {
|
||||
console.log(3,"DOS image was caught")
|
||||
return res.status(400).send('No files were uploaded. (req.files.)');
|
||||
}
|
||||
|
||||
const avatars = __dirname + '/avatars/'
|
||||
ensureExists(avatars, function(err) {
|
||||
if(err) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user