webdav: make FileInfo.ModTime optional
This commit is contained in:
@@ -166,9 +166,12 @@ func (b *backend) propfindFile(propfind *internal.Propfind, fi *FileInfo) (*inte
|
|||||||
props[internal.GetContentLengthName] = func(*internal.RawXMLValue) (interface{}, error) {
|
props[internal.GetContentLengthName] = func(*internal.RawXMLValue) (interface{}, error) {
|
||||||
return &internal.GetContentLength{Length: fi.Size}, nil
|
return &internal.GetContentLength{Length: fi.Size}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !fi.ModTime.IsZero() {
|
||||||
props[internal.GetLastModifiedName] = func(*internal.RawXMLValue) (interface{}, error) {
|
props[internal.GetLastModifiedName] = func(*internal.RawXMLValue) (interface{}, error) {
|
||||||
return &internal.GetLastModified{LastModified: internal.Time(fi.ModTime)}, nil
|
return &internal.GetLastModified{LastModified: internal.Time(fi.ModTime)}, nil
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if fi.MIMEType != "" {
|
if fi.MIMEType != "" {
|
||||||
props[internal.GetContentTypeName] = func(*internal.RawXMLValue) (interface{}, error) {
|
props[internal.GetContentTypeName] = func(*internal.RawXMLValue) (interface{}, error) {
|
||||||
|
Reference in New Issue
Block a user