Use default expiry with API

This commit is contained in:
BBaoVanC 2021-12-17 23:48:51 -06:00
parent d63a875b12
commit e26fb92394
No known key found for this signature in database
GPG Key ID: 18089E4E3CCF1D3A
1 changed files with 2 additions and 2 deletions

View File

@ -405,11 +405,11 @@ func barePlusExt(filename string) (barename, extension string) {
func parseExpiry(expStr string) time.Duration {
if expStr == "" {
return time.Duration(Config.maxExpiry) * time.Second
return time.Duration(Config.defaultExpiry) * time.Second
} else {
fileExpiry, err := strconv.ParseUint(expStr, 10, 64)
if err != nil {
return time.Duration(Config.maxExpiry) * time.Second
return time.Duration(Config.defaultExpiry) * time.Second
} else {
if Config.maxExpiry > 0 && (fileExpiry > Config.maxExpiry || fileExpiry == 0) {
fileExpiry = Config.maxExpiry