1
0
Fork 1
mirror of https://github.com/distribution/distribution synced 2024-09-05 18:38:53 +00:00

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 <gs1983@gmail.com>
This commit is contained in:
Gleb Schukin 2016-05-11 15:06:08 +03:00
parent e69f108924
commit 52eecb556c

View file

@ -1737,10 +1737,12 @@ func (c *Connection) Object(container string, objectName string) (info Object, h
return return
} }
} }
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
} }