mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-04-14 00:18:03 +02:00
fix: only allow png/jpg/bmp in cover/profile images
This commit is contained in:
@@ -215,6 +215,13 @@ describe('Upload Controllers', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('should not allow svg uploads', function (done) {
|
||||
socketUser.updateCover({ uid: 1 }, { uid: 1, imageData: 'data:image/svg;base64,PHN2Zy9vbmxvYWQ9YWxlcnQoMik+' }, function (err) {
|
||||
assert.equal(err.message, '[[error:invalid-image]]');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should not allow non image uploads', function (done) {
|
||||
socketUser.uploadCroppedPicture({ uid: 1 }, { uid: 1, imageData: 'data:text/html;base64,PHN2Zy9vbmxvYWQ9YWxlcnQoMik+' }, function (err) {
|
||||
assert.equal(err.message, '[[error:invalid-image]]');
|
||||
@@ -222,6 +229,13 @@ describe('Upload Controllers', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('should not allow svg uploads', function (done) {
|
||||
socketUser.uploadCroppedPicture({ uid: 1 }, { uid: 1, imageData: 'data:image/svg;base64,PHN2Zy9vbmxvYWQ9YWxlcnQoMik+' }, function (err) {
|
||||
assert.equal(err.message, '[[error:invalid-image]]');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should delete users uploads if account is deleted', function (done) {
|
||||
var jar;
|
||||
var uid;
|
||||
|
||||
Reference in New Issue
Block a user