From bd649f8c469c8d88f392bcb747ea03eaf90ab98c Mon Sep 17 00:00:00 2001 From: Brian Wheeler Date: Thu, 16 May 2024 15:35:12 -0400 Subject: [PATCH] Set the media type for directories --- backend/posix/posix.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/posix/posix.go b/backend/posix/posix.go index c95f336..2d41803 100644 --- a/backend/posix/posix.go +++ b/backend/posix/posix.go @@ -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 {