diff --git a/swift/proxy/controllers/base.py b/swift/proxy/controllers/base.py index a5972bd8e1..c3b133e45d 100644 --- a/swift/proxy/controllers/base.py +++ b/swift/proxy/controllers/base.py @@ -185,7 +185,8 @@ def headers_to_object_info(headers, status_int=HTTP_OK): 'length': headers.get('content-length'), 'type': headers.get('content-type'), 'etag': headers.get('etag'), - 'meta': meta + 'meta': meta, + 'sysmeta': sysmeta } return info diff --git a/test/unit/proxy/controllers/test_base.py b/test/unit/proxy/controllers/test_base.py index 04039fbf2a..2c2094ffed 100644 --- a/test/unit/proxy/controllers/test_base.py +++ b/test/unit/proxy/controllers/test_base.py @@ -523,6 +523,15 @@ class TestFuncs(unittest.TestCase): self.assertEquals(resp['meta']['whatevs'], 14) self.assertEquals(resp['meta']['somethingelse'], 0) + def test_headers_to_object_info_sys_meta(self): + prefix = get_sys_meta_prefix('object') + headers = {'%sWhatevs' % prefix: 14, + '%ssomethingelse' % prefix: 0} + resp = headers_to_object_info(headers.items(), 200) + self.assertEquals(len(resp['sysmeta']), 2) + self.assertEquals(resp['sysmeta']['whatevs'], 14) + self.assertEquals(resp['sysmeta']['somethingelse'], 0) + def test_headers_to_object_info_values(self): headers = { 'content-length': '1024',