Revision f6c97079 pithos/api/util.py
b/pithos/api/util.py | ||
---|---|---|
96 | 96 |
return meta, groups |
97 | 97 |
|
98 | 98 |
def put_account_headers(response, meta, groups): |
99 |
response['X-Account-Container-Count'] = meta['count'] |
|
100 |
response['X-Account-Bytes-Used'] = meta['bytes'] |
|
99 |
if 'count' in meta: |
|
100 |
response['X-Account-Container-Count'] = meta['count'] |
|
101 |
if 'bytes' in meta: |
|
102 |
response['X-Account-Bytes-Used'] = meta['bytes'] |
|
101 | 103 |
if 'modified' in meta: |
102 | 104 |
response['Last-Modified'] = http_date(int(meta['modified'])) |
103 | 105 |
for k in [x for x in meta.keys() if x.startswith('X-Account-Meta-')]: |
... | ... | |
113 | 115 |
return meta, policy |
114 | 116 |
|
115 | 117 |
def put_container_headers(response, meta, policy): |
116 |
response['X-Container-Object-Count'] = meta['count'] |
|
117 |
response['X-Container-Bytes-Used'] = meta['bytes'] |
|
118 |
if 'count' in meta: |
|
119 |
response['X-Container-Object-Count'] = meta['count'] |
|
120 |
if 'bytes' in meta: |
|
121 |
response['X-Container-Bytes-Used'] = meta['bytes'] |
|
118 | 122 |
response['Last-Modified'] = http_date(int(meta['modified'])) |
119 | 123 |
for k in [x for x in meta.keys() if x.startswith('X-Container-Meta-')]: |
120 | 124 |
response[k.encode('utf-8')] = meta[k].encode('utf-8') |
Also available in: Unified diff