From e26fb923942b559c66b15c7d8596e0a3ac3dc21b Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Fri, 17 Dec 2021 23:48:51 -0600 Subject: [PATCH] Use default expiry with API --- upload.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upload.go b/upload.go index bd2b948..8e5fc91 100644 --- a/upload.go +++ b/upload.go @@ -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