diff options
author | Kyle Knapp <kyleknap@amazon.com> | 2014-09-19 13:08:42 -0700 |
---|---|---|
committer | Kyle Knapp <kyleknap@amazon.com> | 2014-09-19 13:08:42 -0700 |
commit | 8853e8ef2d4233132767671730c542d4dcbd2506 (patch) | |
tree | 3207f830aff6a0bcfcbaff0edafed3b7bbca28e9 /tests/unit | |
parent | 8c6ea21f25895c5c62eabae89d2be622f0e5c8e0 (diff) | |
parent | 6030ef859c93c6472443e0221bfcdc9c8a3466ce (diff) | |
download | boto-8853e8ef2d4233132767671730c542d4dcbd2506.tar.gz |
Merge pull request #2604 from kyleknap/bjs-s3
Fix bug where sigv4 custom metadata headers were presigned incorrectly.
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/s3/test_connection.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/unit/s3/test_connection.py b/tests/unit/s3/test_connection.py index 35ebce97..5839a6a2 100644 --- a/tests/unit/s3/test_connection.py +++ b/tests/unit/s3/test_connection.py @@ -135,6 +135,26 @@ class TestSigV4Presigned(MockServiceWithConfigTestCase): self.assertIn('VersionId=2', url) self.assertIn('X-Amz-Security-Token=token', url) + def test_sigv4_presign_headers(self): + self.config = { + 's3': { + 'use-sigv4': True, + } + } + + conn = self.connection_class( + aws_access_key_id='less', + aws_secret_access_key='more', + host='s3.amazonaws.com' + ) + + headers = {'x-amz-meta-key': 'val'} + url = conn.generate_url_sigv4(86400, 'GET', bucket='examplebucket', + key='test.txt', headers=headers) + + self.assertIn('host', url) + self.assertIn('x-amz-meta-key', url) + class TestUnicodeCallingFormat(AWSMockServiceTestCase): connection_class = S3Connection |