mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
Limit memory mode at 100 buckets and return error appropriately
~~~ mc: <ERROR> Failed to create bucket for URL [http://localhost:9000/newbucket-101]. Reason: [You have attempted to create more buckets than allowed.]. ~~~ Response from server
This commit is contained in:
@@ -171,6 +171,10 @@ func (server *minioAPI) putBucketHandler(w http.ResponseWriter, req *http.Reques
|
||||
w.Header().Set("Connection", "close")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
case drivers.TooManyBuckets:
|
||||
{
|
||||
writeErrorResponse(w, req, TooManyBuckets, acceptsContentType, req.URL.Path)
|
||||
}
|
||||
case drivers.BucketNameInvalid:
|
||||
{
|
||||
writeErrorResponse(w, req, InvalidBucketName, acceptsContentType, req.URL.Path)
|
||||
|
||||
@@ -163,6 +163,10 @@ func (server *minioAPI) putObjectHandler(w http.ResponseWriter, req *http.Reques
|
||||
w.WriteHeader(http.StatusOK)
|
||||
case drivers.ObjectExists:
|
||||
{
|
||||
// we need to debate about this, if this is the right message to send back
|
||||
// https://github.com/minio-io/minio/issues/505
|
||||
|
||||
// Ideally we can use 405 Method No Allowed
|
||||
writeErrorResponse(w, req, NotImplemented, acceptsContentType, req.URL.Path)
|
||||
}
|
||||
case drivers.BadDigest:
|
||||
|
||||
@@ -20,12 +20,13 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"time"
|
||||
|
||||
router "github.com/gorilla/mux"
|
||||
"github.com/minio-io/minio/pkg/api/config"
|
||||
"github.com/minio-io/minio/pkg/api/quota"
|
||||
"github.com/minio-io/minio/pkg/iodine"
|
||||
"github.com/minio-io/minio/pkg/storage/drivers"
|
||||
"time"
|
||||
)
|
||||
|
||||
// private use
|
||||
|
||||
Reference in New Issue
Block a user