Skip to content

Commit

Permalink
fix validation
Browse files Browse the repository at this point in the history
  • Loading branch information
eranchetz committed Jul 7, 2020
1 parent de1dc76 commit 337d90e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ func (v vault) Store(msg string, ttl string) (token string, err error) {
}

// validate duration length
if d > 168 * time.Hour{
return "", fmt.Errorf("cannot set ttl to more than 7 days %v", err)
if d > 168 * time.Hour || d == 0 * time.Hour {
return "", fmt.Errorf("cannot set ttl to infinte or more than 7 days %v", err)
}

t, err := v.createOneTimeToken(ttl)
Expand Down

0 comments on commit 337d90e

Please sign in to comment.