Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 70e8f54

Browse files
committed
Fix avatar upload due to hapijs upgrade
1 parent 935339c commit 70e8f54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

profiles.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ module.exports = function (options) {
478478
if (!_.contains(args.fileType, 'image')) return done(null, {ok: false, why: 'Avatar upload: file must be an image.'});
479479
if (file.length > 5242880) return done(null, {ok: false, why: 'Avatar upload: max file size of 5MB exceeded.'});
480480

481-
var buf = new Buffer(file, 'base64');
481+
var buf = new Buffer(file.data, 'base64');
482482
var type = buf.toString('hex', 0, 4);
483483
var types = ['ffd8ffe0', '89504e47', '47494638'];
484484
if (!_.contains(types, type)) return done(null, {ok: false, why: 'Avatar upload: file must be an image of type png, jpeg or gif.'});

0 commit comments

Comments
 (0)