From daf28dde7c20f644ac612cbc6d3d85f152f848ad Mon Sep 17 00:00:00 2001 From: Doug Weimer Date: Tue, 30 Aug 2011 08:11:26 -0700 Subject: [PATCH] Changed GETorHEAD_base to return an object even when HTTP_X_NEWEST is set and none of the requested objects have a timestamp set. --- swift/proxy/server.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/swift/proxy/server.py b/swift/proxy/server.py index 1099030577..7d7ee49d7e 100644 --- a/swift/proxy/server.py +++ b/swift/proxy/server.py @@ -645,13 +645,14 @@ class Controller(object): possible_source.status in (200, 206)) or \ 200 <= possible_source.status <= 399: if newest: - ts = 0 if source: ts = float(source.getheader('x-put-timestamp') or source.getheader('x-timestamp') or 0) - pts = float(possible_source.getheader('x-put-timestamp') or - possible_source.getheader('x-timestamp') or 0) - if pts > ts: + pts = float(possible_source.getheader('x-put-timestamp') or + possible_source.getheader('x-timestamp') or 0) + if pts > ts: + source = possible_source + else: source = possible_source continue else: