Merge pull request #572 from bdwheele/s3fs-fixes

Set the media type for directories
This commit is contained in:
Ben McClelland
2024-05-16 14:50:06 -07:00
committed by GitHub
+5
View File
@@ -1596,6 +1596,11 @@ func (p *Posix) HeadObject(ctx context.Context, input *s3.HeadObjectInput) (*s3.
userMetaData := make(map[string]string)
contentType, contentEncoding := p.loadUserMetaData(bucket, object, userMetaData)
if fi.IsDir() {
// this is the media type for directories in AWS and Nextcloud
contentType = "application/x-directory"
}
b, err := p.meta.RetrieveAttribute(bucket, object, etagkey)
etag := string(b)
if err != nil {