mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
listObjects optimized to handle max-keys=1 when prefix is object (#13000)
Some applications albeit poorly written rather than using headObject rely on listObjects to check for existence of object, this unusual request always has prefix=(to actual object) and max-keys=1 handle this situation specially such that we can avoid readdir() on the top level parent to avoid sorting and skipping, ensuring that such type of listObjects() always behaves similar to a headObject() call.
This commit is contained in:
@@ -331,7 +331,7 @@ func (s *storageRESTServer) WalkDirHandler(w http.ResponseWriter, r *http.Reques
|
||||
}
|
||||
|
||||
var reportNotFound bool
|
||||
if v := vars[storageRESTReportNotFound]; v != "" {
|
||||
if v := r.Form.Get(storageRESTReportNotFound); v != "" {
|
||||
reportNotFound, err = strconv.ParseBool(v)
|
||||
if err != nil {
|
||||
s.writeErrorResponse(w, err)
|
||||
|
||||
Reference in New Issue
Block a user