mirror of https://github.com/minio/minio.git
Relax minium object size limit, one can really upload a 0byte file
For example ~~~ $ mc ls https://s3.amazonaws.com/ferenginar/test.go [2015-05-23 12:02:06 PDT] 0B test.go $ curl -i -X HEAD https://s3.amazonaws.com/ferenginar/test.go HTTP/1.1 200 OK x-amz-id-2: ZMWLriPH+uQJ8IsaMHmuNOU/FXvdSq+s6O7ugUI9hZ695XJTNAZ1utKxh03w5Jcf x-amz-request-id: F5A11F533B74DD8F Date: Sat, 23 May 2015 19:19:29 GMT Last-Modified: Sat, 23 May 2015 19:02:06 GMT ETag: "d41d8cd98f00b204e9800998ecf8427e" Accept-Ranges: bytes Content-Type: binary/octet-stream Content-Length: 0 Server: AmazonS3 ~~~
This commit is contained in:
parent
d89396e2f0
commit
9666f2e5bf
|
@ -168,10 +168,19 @@ func (server *minioAPI) putObjectHandler(w http.ResponseWriter, req *http.Reques
|
|||
return
|
||||
}
|
||||
/// minimum Upload size for objects in a single operation
|
||||
if isMinObjectSize(size) {
|
||||
writeErrorResponse(w, req, EntityTooSmall, acceptsContentType, req.URL.Path)
|
||||
return
|
||||
}
|
||||
//
|
||||
// Surprisingly while Amazon in their document states that S3 objects have 1byte
|
||||
// as the minimum limit, they do not seem to enforce it one can successfully
|
||||
// create a 0byte file using a regular putObject() operation
|
||||
//
|
||||
// For example take a look at :-
|
||||
//
|
||||
// $ mc ls https://s3.amazonaws.com/ferenginar/test.go
|
||||
//
|
||||
// if isMinObjectSize(size) {
|
||||
// writeErrorResponse(w, req, EntityTooSmall, acceptsContentType, req.URL.Path)
|
||||
// return
|
||||
// }
|
||||
sizeInt64, err := strconv.ParseInt(size, 10, 64)
|
||||
if err != nil {
|
||||
writeErrorResponse(w, req, InvalidRequest, acceptsContentType, req.URL.Path)
|
||||
|
@ -275,15 +284,6 @@ func (server *minioAPI) putObjectPartHandler(w http.ResponseWriter, req *http.Re
|
|||
return
|
||||
}
|
||||
|
||||
// last part can be less than < 5MB so we need to figure out a way to handle it first
|
||||
// and then enable below code (y4m4)
|
||||
//
|
||||
/// minimum Upload size for multipart objects in a single operation
|
||||
// if isMinMultipartObjectSize(size) {
|
||||
// writeErrorResponse(w, req, EntityTooSmall, acceptsContentType, req.URL.Path)
|
||||
// return
|
||||
// }
|
||||
|
||||
sizeInt64, err := strconv.ParseInt(size, 10, 64)
|
||||
if err != nil {
|
||||
writeErrorResponse(w, req, InvalidRequest, acceptsContentType, req.URL.Path)
|
||||
|
|
Loading…
Reference in New Issue