diff --git a/swift/common/middleware/slo.py b/swift/common/middleware/slo.py index ac49ae65ff..4ff2d21cbc 100644 --- a/swift/common/middleware/slo.py +++ b/swift/common/middleware/slo.py @@ -703,7 +703,7 @@ class StaticLargeObject(object): elif len(ranges) > 1: problem_segments.append([quote(obj_name), 'Multiple Ranges']) - elif ranges == [(0, seg_dict['size_bytes'])]: + elif ranges == [(0, head_seg_resp.content_length)]: # Just one range, and it exactly matches the object. # Why'd we do this again? seg_dict['range'] = None diff --git a/test/unit/common/middleware/test_slo.py b/test/unit/common/middleware/test_slo.py index b131240361..f8455a96e6 100644 --- a/test/unit/common/middleware/test_slo.py +++ b/test/unit/common/middleware/test_slo.py @@ -530,7 +530,7 @@ class TestSloPutManifest(SloTestCase): def test_handle_single_ranges(self): good_data = json.dumps( [{'path': '/checktest/a_1', 'etag': None, - 'size_bytes': 1, 'range': '0-0'}, + 'size_bytes': None, 'range': '0-0'}, {'path': '/checktest/b_2', 'etag': None, 'size_bytes': 2, 'range': '-1'}, {'path': '/checktest/b_2', 'etag': None,