webdav: make FileInfo.ModTime optional in client

This commit is contained in:
Simon Ser 2020-01-21 22:47:48 +01:00
parent 82bdd23de4
commit 83272e2195
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -61,11 +61,15 @@ func fileInfoFromResponse(resp *internal.Response) (*FileInfo, error) {
fi.IsDir = true fi.IsDir = true
} else { } else {
var getLen internal.GetContentLength var getLen internal.GetContentLength
var getMod internal.GetLastModified
if err := resp.DecodeProp(&getLen, &getMod); err != nil { if err := resp.DecodeProp(&getLen, &getMod); err != nil {
return nil, err return nil, err
} }
var getMod internal.GetLastModified
if err := resp.DecodeProp(&getMod); err != nil && !internal.IsNotFound(err) {
return nil, err
}
var getType internal.GetContentType var getType internal.GetContentType
if err := resp.DecodeProp(&getType); err != nil && !internal.IsNotFound(err) { if err := resp.DecodeProp(&getType); err != nil && !internal.IsNotFound(err) {
return nil, err return nil, err