Skip to content

Commit

Permalink
Merge pull request #147 from waifuvault/fix-missing-secret
Browse files Browse the repository at this point in the history
Fix handling of undefined secret
  • Loading branch information
nakedmcse authored Apr 13, 2024
2 parents ba19668 + f9a58dd commit 743fc3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/FileService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export class FileService {
}
value = ObjectUtils.convertToMilli(value, timeFactor);
const maxExp: number | null =
this.secret === secretToken ? null : FileUtils.getTimeLeftBySize(entry.fileSize());
this.secret && this.secret === secretToken ? null : FileUtils.getTimeLeftBySize(entry.fileSize());

if (maxExp !== null && value > maxExp) {
throw new BadRequest(`Cannot extend time remaining beyond ${ObjectUtils.timeToHuman(maxExp)}`);
Expand Down

0 comments on commit 743fc3a

Please sign in to comment.