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

View file

@ -1737,10 +1737,15 @@ func (c *Connection) Object(container string, objectName string) (info Object, h
return 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") info.ServerLastModified = resp.Header.Get("Last-Modified")
if info.LastModified, err = time.Parse(http.TimeFormat, info.ServerLastModified); err != nil { if info.LastModified, err = time.Parse(http.TimeFormat, info.ServerLastModified); err != nil {
return return
} }
}
info.Hash = resp.Header.Get("Etag") info.Hash = resp.Header.Get("Etag")
return return
} }