Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Commit

Permalink
Use default expiry with API
Browse files Browse the repository at this point in the history
  • Loading branch information
BBaoVanC committed Dec 18, 2021
1 parent 21d75c4 commit 833c907
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions upload.go
Expand Up @@ -407,11 +407,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
Expand Down

0 comments on commit 833c907

Please sign in to comment.