Skip to content

Commit 6dbaa5c

Browse files
yaronfclaude
andcommitted
fix: ignore non-positive delay in SetExpiresAfter
A zero or negative delay would silently produce an expires value in the past or be treated as "unset" inconsistently. Guard the assignment so only positive delays take effect, matching the semantics of the existing expires == 0 sentinel. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 691910b commit 6dbaa5c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

config.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ func (c *SignConfig) SetExpires(expires int64) *SignConfig {
6666
// Use this for a relative validity window instead of an absolute timestamp.
6767
// Default: 0 (do not add the parameter).
6868
func (c *SignConfig) SetExpiresAfter(delay int64) *SignConfig {
69-
c.expiresAfter = delay
69+
if delay > 0 {
70+
c.expiresAfter = delay
71+
}
7072
return c
7173
}
7274

0 commit comments

Comments
 (0)