webdav: make FileInfo.ModTime optional

This commit is contained in:
Simon Ser 2020-01-21 22:44:10 +01:00
parent 02d1a7dbe8
commit 23fa5c582c
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -166,8 +166,11 @@ func (b *backend) propfindFile(propfind *internal.Propfind, fi *FileInfo) (*inte
props[internal.GetContentLengthName] = func(*internal.RawXMLValue) (interface{}, error) {
return &internal.GetContentLength{Length: fi.Size}, nil
}
props[internal.GetLastModifiedName] = func(*internal.RawXMLValue) (interface{}, error) {
return &internal.GetLastModified{LastModified: internal.Time(fi.ModTime)}, nil
if !fi.ModTime.IsZero() {
props[internal.GetLastModifiedName] = func(*internal.RawXMLValue) (interface{}, error) {
return &internal.GetLastModified{LastModified: internal.Time(fi.ModTime)}, nil
}
}
if fi.MIMEType != "" {