mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-22 16:24:14 +00:00
webdav: make FileInfo.ModTime optional
This commit is contained in:
parent
02d1a7dbe8
commit
23fa5c582c
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user