From 36ee110563c809c2b1378300e86e1b9f9ee66305 Mon Sep 17 00:00:00 2001 From: ebozduman Date: Tue, 9 Jul 2019 22:18:43 -0700 Subject: [PATCH] Regression fix to bring back checkPolicyCond function call (#7897) Fixes #7895 --- cmd/bucket-handlers.go | 2 +- cmd/postpolicyform.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/bucket-handlers.go b/cmd/bucket-handlers.go index 545e9f2f3..9b1706886 100644 --- a/cmd/bucket-handlers.go +++ b/cmd/bucket-handlers.go @@ -537,7 +537,7 @@ func (api objectAPIHandlers) PostPolicyBucketHandler(w http.ResponseWriter, r *h return } - // Remove all tmp files creating during multipart upload + // Remove all tmp files created during multipart upload defer form.RemoveAll() // Extract all form fields diff --git a/cmd/postpolicyform.go b/cmd/postpolicyform.go index 4d64d342e..b9ea60b10 100644 --- a/cmd/postpolicyform.go +++ b/cmd/postpolicyform.go @@ -109,7 +109,7 @@ type PostPolicyForm struct { } } -// parsePostPolicyForm - Parse JSON policy string into typed POostPolicyForm structure. +// parsePostPolicyForm - Parse JSON policy string into typed PostPolicyForm structure. func parsePostPolicyForm(policy string) (ppf PostPolicyForm, e error) { // Convert po into interfaces and // perform strict type conversion using reflection. @@ -256,6 +256,7 @@ func checkPostPolicy(formValues http.Header, postPolicyForm PostPolicyForm) erro return fmt.Errorf("Invalid according to Policy: Policy Condition failed") } // Check if current policy condition is satisfied + condPassed = checkPolicyCond(op, formValues.Get(formCanonicalName), v.Value) if !condPassed { return fmt.Errorf("Invalid according to Policy: Policy Condition failed") }