diff --git a/cmd/fs-v1.go b/cmd/fs-v1.go index bac35f6ae..fc5d55bee 100644 --- a/cmd/fs-v1.go +++ b/cmd/fs-v1.go @@ -709,7 +709,7 @@ func (fs *FSObjects) GetObjectNInfo(ctx context.Context, bucket, object string, nsUnlocker() return nil, toObjectErr(err, bucket, object) } - // For a directory, we need to send an reader that returns no bytes. + // For a directory, we need to return a reader that returns no bytes. if HasSuffix(object, SlashSeparator) { // The lock taken above is released when // objReader.Close() is called by the caller. @@ -958,6 +958,10 @@ func (fs *FSObjects) getObjectInfoNoFSLock(ctx context.Context, bucket, object s // getObjectInfo - wrapper for reading object metadata and constructs ObjectInfo. func (fs *FSObjects) getObjectInfo(ctx context.Context, bucket, object string) (oi ObjectInfo, e error) { + if strings.HasSuffix(object, SlashSeparator) && !fs.isObjectDir(bucket, object) { + return oi, errFileNotFound + } + fsMeta := fsMetaV1{} if HasSuffix(object, SlashSeparator) { fi, err := fsStatDir(ctx, pathJoin(fs.fsPath, bucket, object))