Fixing metadata key on s3 operation response

ETag metadata key is being returned as "Etag" instead of "ETag". This leads to issues in some AWS SDKs using MotoServer. This change fixes the issue by updating the key to the correct format.

This closes #920
This commit is contained in:
Hugo Picado 2017-04-27 13:57:18 +01:00
parent df84675ae6
commit 0945765537
No known key found for this signature in database
GPG Key ID: 7F73DE7BA2ECDA09
2 changed files with 2 additions and 1 deletions

View File

@ -91,7 +91,7 @@ class FakeKey(BaseModel):
@property
def response_dict(self):
res = {
'Etag': self.etag,
'ETag': self.etag,
'last-modified': self.last_modified_RFC1123,
'content-length': str(len(self.value)),
}

View File

@ -34,6 +34,7 @@ def test_s3_server_bucket_create():
res = test_client.put(
'/bar', 'http://foobaz.localhost:5000/', data='test value')
res.status_code.should.equal(200)
assert 'ETag' in dict(res.headers)
res = test_client.get('/bar', 'http://foobaz.localhost:5000/')
res.status_code.should.equal(200)