mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-14 08:26:22 +00:00
fix: empty string for age header failing
This commit is contained in:
parent
04d2dff0f6
commit
f3b7d5e56d
@ -250,15 +250,12 @@ self.assertRetentionPeriod = (user, age) => {
|
||||
throw new ClientError('You are not eligible for any file retention periods.', { statusCode: 403 })
|
||||
}
|
||||
|
||||
let parsed = null
|
||||
if (age === undefined || age === null) {
|
||||
let parsed = parseFloat(age)
|
||||
if (Number.isNaN(parsed) || age < 0) {
|
||||
parsed = utils.retentions.default[group]
|
||||
} else {
|
||||
parsed = parseFloat(age)
|
||||
if (!utils.retentions.periods[group].includes(parsed)) {
|
||||
} else if (!utils.retentions.periods[group].includes(parsed)) {
|
||||
throw new ClientError('You are not eligible for the specified file retention period.', { statusCode: 403 })
|
||||
}
|
||||
}
|
||||
|
||||
if (!parsed && !utils.retentions.periods[group].includes(0)) {
|
||||
throw new ClientError('Permanent uploads are not permitted.', { statusCode: 403 })
|
||||
|
Loading…
Reference in New Issue
Block a user