diff --git a/core/file_area_web.js b/core/file_area_web.js index 6440eb58..b12f4f7d 100644 --- a/core/file_area_web.js +++ b/core/file_area_web.js @@ -152,16 +152,18 @@ class FileAreaWebAccess { return cb(Errors.Invalid('Invalid or unknown hash ID')); } - return cb( - null, - { - hashId : hashId, - userId : decoded[0], - hashIdType : decoded[1], - fileIds : decoded.slice(2), - expireTimestamp : moment(result.expire_timestamp), - } - ); + const servedItem = { + hashId : hashId, + userId : decoded[0], + hashIdType : decoded[1], + expireTimestamp : moment(result.expire_timestamp), + }; + + if(FileAreaWebAccess.getHashIdTypes().SingleFile === servedItem.hashIdType) { + servedItem.fileIds = decoded.slice(2); + } + + return cb(null, servedItem); } ); }