webdav: add workaround for missing mtime - fixes #2420

This commit is contained in:
buergi
2018-10-14 17:19:23 +01:00
committed by Nick Craig-Wood
parent 5dac8e055f
commit 753cc63d96
+6
View File
@@ -155,6 +155,12 @@ func (t *Time) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
return err
}
// If time is missing then return the epoch
if v == "" {
*t = Time(time.Unix(0, 0))
return nil
}
// Parse the time format in multiple possible ways
var newT time.Time
for _, timeFormat := range timeFormats {