fs/xl: Combine input checks into re-usable functions. (#3383)

Repeated code around both object layers are moved
and combined into simple re-usable functions.
This commit is contained in:
Harshavardhana
2016-12-01 23:15:17 -08:00
committed by GitHub
parent 918924796f
commit ff4ce0ee14
20 changed files with 216 additions and 418 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ import (
// Enforces bucket policies for a bucket for a given tatusaction.
func enforceBucketPolicy(bucket string, action string, reqURL *url.URL) (s3Error APIErrorCode) {
// Verify if bucket actually exists
if err := isBucketExist(bucket, newObjectLayerFn()); err != nil {
if err := checkBucketExist(bucket, newObjectLayerFn()); err != nil {
err = errorCause(err)
switch err.(type) {
case BucketNameInvalid: