webdav: add workaround for missing mtime - fixes #2420

This commit is contained in:
buergi 2018-09-08 15:17:02 +02:00 committed by Nick Craig-Wood
parent 5dac8e055f
commit 753cc63d96

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 {