From 52eecb556c0096f0f331b52a0ee818951af576c8 Mon Sep 17 00:00:00 2001 From: Gleb Schukin Date: Wed, 11 May 2016 15:06:08 +0300 Subject: [PATCH] Handle rare case when ceph doesn't return Last-Modified for HEAD requests in case DLO manifest doesn't have any segments Signed-off-by: Gleb Schukin --- vendor/github.com/ncw/swift/swift.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vendor/github.com/ncw/swift/swift.go b/vendor/github.com/ncw/swift/swift.go index 290f73a7e..e5be4ebc4 100644 --- a/vendor/github.com/ncw/swift/swift.go +++ b/vendor/github.com/ncw/swift/swift.go @@ -1737,9 +1737,11 @@ 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 + 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