Skip to content

Commit

Permalink
Always return size in ocdav (#712)
Browse files Browse the repository at this point in the history
Return the file size in ocdav regardless whether the mime type was
detected or not
  • Loading branch information
Vincent Petry authored May 5, 2020
1 parent 16dcc5c commit c768bcc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/http/services/owncloud/ocdav/propfind.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,15 @@ func (s *svc) mdToPropResponse(ctx context.Context, pf *propfindXML, md *provide
s.newProp("d:getcontenttype", "httpd/unix-directory"),
s.newProp("oc:size", size),
)
} else if md.MimeType != "" {
} else {
response.Propstat[0].Prop = append(response.Propstat[0].Prop,
s.newProp("d:getcontenttype", md.MimeType),
s.newProp("d:getcontentlength", size),
)
if md.MimeType != "" {
response.Propstat[0].Prop = append(response.Propstat[0].Prop,
s.newProp("d:getcontenttype", md.MimeType),
)
}
}
// Finder needs the the getLastModified property to work.
t := utils.TSToTime(md.Mtime).UTC()
Expand Down

0 comments on commit c768bcc

Please sign in to comment.