From a2b545423f4d967f656288e5c0a741041be4ded7 Mon Sep 17 00:00:00 2001 From: Kudou Sterain <40029631+hotrungnhan@users.noreply.github.com> Date: Sun, 10 Jul 2022 04:15:39 +0700 Subject: [PATCH] fix: postPolicy contentRange max must be > 0 (#1675) fixes #1675 --- post-policy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/post-policy.go b/post-policy.go index 7aa96e0d6..7bf560304 100644 --- a/post-policy.go +++ b/post-policy.go @@ -197,8 +197,8 @@ func (p *PostPolicy) SetContentLengthRange(min, max int64) error { if min < 0 { return errInvalidArgument("Minimum limit cannot be negative.") } - if max < 0 { - return errInvalidArgument("Maximum limit cannot be negative.") + if max <= 0 { + return errInvalidArgument("Maximum limit cannot be non-positive.") } p.contentLengthRange.min = min p.contentLengthRange.max = max