Regression fix to bring back checkPolicyCond function call (#7897)

Fixes #7895
This commit is contained in:
ebozduman 2019-07-09 22:18:43 -07:00 committed by Nitish Tiwari
parent 1dc25bcf5f
commit 36ee110563
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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")
}