From 346d4c587cc8e6c426f599715cb6483b727fe32c Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 8 Sep 2016 16:44:11 +0100 Subject: [PATCH] swift: don't read metadata for directory marker objects - fixes #703 --- swift/swift.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swift/swift.go b/swift/swift.go index 17382a89b..0f515449e 100644 --- a/swift/swift.go +++ b/swift/swift.go @@ -236,7 +236,8 @@ func (f *Fs) newObjectWithInfo(remote string, info *swift.Object) (fs.Object, er // Note that due to a quirk of swift, dynamic large objects are // returned as 0 bytes in the listing. Correct this here by // making sure we read the full metadata for all 0 byte files. - if info != nil && info.Bytes == 0 { + // We don't read the metadata for directory marker objects. + if info != nil && info.Bytes == 0 && info.ContentType != "application/directory" { info = nil } if info != nil {