diff --git a/swift/proxy/controllers/obj.py b/swift/proxy/controllers/obj.py index 1a0d1f187a..f09bcbd23c 100644 --- a/swift/proxy/controllers/obj.py +++ b/swift/proxy/controllers/obj.py @@ -2057,6 +2057,7 @@ class ECObjectController(BaseObjectController): headers=resp_headers, conditional_response=True, app_iter=app_iter) + resp.accept_ranges = 'bytes' app_iter.kickoff(req, resp) else: statuses = [] diff --git a/test/unit/proxy/controllers/test_obj.py b/test/unit/proxy/controllers/test_obj.py index 655bf07700..fcab9ad9e0 100755 --- a/test/unit/proxy/controllers/test_obj.py +++ b/test/unit/proxy/controllers/test_obj.py @@ -390,6 +390,7 @@ class BaseObjectControllerMixin(object): with set_http_connect(200): resp = req.get_response(self.app) self.assertEqual(resp.status_int, 200) + self.assertIn('Accept-Ranges', resp.headers) def test_HEAD_x_newest(self): req = swift.common.swob.Request.blank('/v1/a/c/o', method='HEAD', @@ -693,6 +694,7 @@ class TestReplicatedObjController(BaseObjectControllerMixin, with set_http_connect(200): resp = req.get_response(self.app) self.assertEqual(resp.status_int, 200) + self.assertIn('Accept-Ranges', resp.headers) def test_GET_error(self): req = swift.common.swob.Request.blank('/v1/a/c/o') @@ -1173,6 +1175,7 @@ class TestECObjController(BaseObjectControllerMixin, unittest.TestCase): with set_http_connect(*get_resp): resp = req.get_response(self.app) self.assertEqual(resp.status_int, 200) + self.assertIn('Accept-Ranges', resp.headers) def test_GET_simple_x_newest(self): req = swift.common.swob.Request.blank('/v1/a/c/o',