mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 16:06:21 +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 })
|
||||
}
|
||||
|
||||
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)) {
|
||||
throw new ClientError('You are not eligible for the specified file retention period.', { statusCode: 403 })
|
||||
}
|
||||
} 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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user