swift: don't read metadata for directory marker objects - fixes #703

This commit is contained in:
Nick Craig-Wood 2016-09-08 16:44:11 +01:00
parent d5b16c8b1a
commit 346d4c587c
1 changed files with 2 additions and 1 deletions

View File

@ -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 {