Merge pull request #1719 from gschukin/fix_ceph_last_modifed

Handle responce from ceph correctly if no Last-Modifed header specified
This commit is contained in:
Richard Scothern 2016-05-27 11:34:39 -07:00
commit 6a40198283

11
vendor/github.com/ncw/swift/swift.go generated vendored
View file

@ -1737,9 +1737,14 @@ func (c *Connection) Object(container string, objectName string) (info Object, h
return
}
}
info.ServerLastModified = resp.Header.Get("Last-Modified")
if info.LastModified, err = time.Parse(http.TimeFormat, info.ServerLastModified); err != nil {
return
//HACK
//Currently ceph doestn't return Last-Modified header for DLO manifest without any segments
//Currently it affects all versions of ceph http://tracker.ceph.com/issues/15812
if resp.Header.Get("Last-Modified") != "" {
info.ServerLastModified = resp.Header.Get("Last-Modified")
if info.LastModified, err = time.Parse(http.TimeFormat, info.ServerLastModified); err != nil {
return
}
}
info.Hash = resp.Header.Get("Etag")
return