api: Fix the conditional to check for reserved buckets. (#4856)

Current code was an logical `and` instead we should do `or`.

Fixes https://github.com/minio/mc/issues/2231
master
Harshavardhana 7 years ago committed by Dee Koder
parent ea65350308
commit 6cab6d802d
  1. 2
      cmd/generic-handlers.go

@ -213,7 +213,7 @@ func setPrivateBucketHandler(h http.Handler) http.Handler {
func (h minioPrivateBucketHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// For all non browser requests, reject access to 'minioReservedBucketPath'.
bucketName, _ := urlPath2BucketObjectName(r.URL)
if !guessIsBrowserReq(r) && isMinioReservedBucket(bucketName) && isMinioMetaBucket(bucketName) {
if !guessIsBrowserReq(r) && (isMinioReservedBucket(bucketName) || isMinioMetaBucket(bucketName)) {
writeErrorResponse(w, ErrAllAccessDisabled, r.URL)
return
}

Loading…
Cancel
Save