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,14 +250,11 @@ self.assertRetentionPeriod = (user, age) => {
|
|||||||
throw new ClientError('You are not eligible for any file retention periods.', { statusCode: 403 })
|
throw new ClientError('You are not eligible for any file retention periods.', { statusCode: 403 })
|
||||||
}
|
}
|
||||||
|
|
||||||
let parsed = null
|
let parsed = parseFloat(age)
|
||||||
if (age === undefined || age === null) {
|
if (Number.isNaN(parsed) || age < 0) {
|
||||||
parsed = utils.retentions.default[group]
|
parsed = utils.retentions.default[group]
|
||||||
} else {
|
} else if (!utils.retentions.periods[group].includes(parsed)) {
|
||||||
parsed = parseFloat(age)
|
throw new ClientError('You are not eligible for the specified file retention period.', { statusCode: 403 })
|
||||||
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)) {
|
if (!parsed && !utils.retentions.periods[group].includes(0)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user