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:
commit
6a40198283
1 changed files with 8 additions and 3 deletions
11
vendor/github.com/ncw/swift/swift.go
generated
vendored
11
vendor/github.com/ncw/swift/swift.go
generated
vendored
|
@ -1737,9 +1737,14 @@ func (c *Connection) Object(container string, objectName string) (info Object, h
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
info.ServerLastModified = resp.Header.Get("Last-Modified")
|
//HACK
|
||||||
if info.LastModified, err = time.Parse(http.TimeFormat, info.ServerLastModified); err != nil {
|
//Currently ceph doestn't return Last-Modified header for DLO manifest without any segments
|
||||||
return
|
//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")
|
info.Hash = resp.Header.Get("Etag")
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue