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

Fixes #7895
master
ebozduman 5 years ago committed by Nitish Tiwari
parent 1dc25bcf5f
commit 36ee110563
  1. 2
      cmd/bucket-handlers.go
  2. 3
      cmd/postpolicyform.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

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

Loading…
Cancel
Save