mirror of
https://github.com/minio/minio.git
synced 2025-02-25 04:19:13 -05:00
fix: missing fileName will upload failed when PostPolicyBucketHandler (#18240)
This commit is contained in:
parent
128256e3ab
commit
2ac7fee017
@ -1039,11 +1039,14 @@ func (api objectAPIHandlers) PostPolicyBucketHandler(w http.ResponseWriter, r *h
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := formValues["Key"]; !ok {
|
if keyName, ok := formValues["Key"]; !ok {
|
||||||
apiErr := errorCodes.ToAPIErr(ErrMalformedPOSTRequest)
|
apiErr := errorCodes.ToAPIErr(ErrMalformedPOSTRequest)
|
||||||
apiErr.Description = fmt.Sprintf("%s (%v)", apiErr.Description, errors.New("The name of the uploaded key is missing"))
|
apiErr.Description = fmt.Sprintf("%s (%v)", apiErr.Description, errors.New("The name of the uploaded key is missing"))
|
||||||
writeErrorResponse(ctx, w, apiErr, r.URL)
|
writeErrorResponse(ctx, w, apiErr, r.URL)
|
||||||
return
|
return
|
||||||
|
} else if fileName == "" && len(keyName) >= 1 {
|
||||||
|
// if we can't get fileName. We use keyName[0] to fileName
|
||||||
|
fileName = keyName[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
if fileName == "" {
|
if fileName == "" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user