diff --git a/swift/common/utils.py b/swift/common/utils.py index febeeaab72..4540858f8e 100644 --- a/swift/common/utils.py +++ b/swift/common/utils.py @@ -425,7 +425,11 @@ def drop_buffer_cache(fd, offset, length): def normalize_timestamp(timestamp): """ Format a timestamp (string or numeric) into a standardized - xxxxxxxxxx.xxxxx format. + xxxxxxxxxx.xxxxx (10.5) format. + + Note that timestamps using values greater than or equal to November 20th, + 2286 at 17:46 UTC will use 11 digits to represent the number of + seconds. :param timestamp: unix timestamp :returns: normalized timestamp as a string diff --git a/swift/proxy/controllers/obj.py b/swift/proxy/controllers/obj.py index 6609eb9884..c2171f73c7 100644 --- a/swift/proxy/controllers/obj.py +++ b/swift/proxy/controllers/obj.py @@ -861,7 +861,7 @@ class ObjectController(Controller): if 'x-timestamp' in req.headers: try: req.headers['X-Timestamp'] = \ - normalize_timestamp(float(req.headers['x-timestamp'])) + normalize_timestamp(req.headers['x-timestamp']) if hresp.environ and 'swift_x_timestamp' in hresp.environ and \ float(hresp.environ['swift_x_timestamp']) >= \ float(req.headers['x-timestamp']): @@ -1210,7 +1210,7 @@ class ObjectController(Controller): if 'x-timestamp' in req.headers: try: req.headers['X-Timestamp'] = \ - normalize_timestamp(float(req.headers['x-timestamp'])) + normalize_timestamp(req.headers['x-timestamp']) except ValueError: return HTTPBadRequest( request=req, content_type='text/plain',