This repository was archived by the owner on Mar 23, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
localstack-core/localstack/services/s3 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -571,6 +571,8 @@ def encode_user_metadata(metadata: Metadata) -> Metadata:
571571
572572
573573def decode_user_metadata (metadata : Metadata | None ) -> Metadata :
574+ """Decode the user metadata if provided in the RFC2047 format, or leave as is if not. AWS also lowercase the
575+ metadata key"""
574576 if not metadata :
575577 return {}
576578
Original file line number Diff line number Diff line change 1850218502 }
1850318503 }
1850418504 },
18505- "tests/aws/services/s3/test_s3.py::TestS3::test_user_metadata_with_unicode": {
18506- "recorded-date": "30-01-2026, 18:32:26",
18507- "recorded-content": {
18508- "put-object": {
18509- "ChecksumCRC32": "AAAAAA==",
18510- "ChecksumType": "FULL_OBJECT",
18511- "ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"",
18512- "ServerSideEncryption": "AES256",
18513- "ResponseMetadata": {
18514- "HTTPHeaders": {},
18515- "HTTPStatusCode": 200
18516- }
18517- },
18518- "get-object": {
18519- "AcceptRanges": "bytes",
18520- "Body": "",
18521- "ChecksumCRC32": "AAAAAA==",
18522- "ChecksumType": "FULL_OBJECT",
18523- "ContentLength": 0,
18524- "ContentType": "binary/octet-stream",
18525- "ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"",
18526- "LastModified": "datetime",
18527- "Metadata": {
18528- "non-ascii": "=?UTF-8?Q?test=5F=C3=A2=C2=80=C2=94=5Ffile%E?= =?UTF-8?Q?2%80%94=5F=C3=83=C2=A9=5F2.pdf?=",
18529- "non-ascii-2": "=?UTF-8?B?w4PChE3Dg8KEWsODwpXDg8KRIFMz?="
18530- },
18531- "ServerSideEncryption": "AES256",
18532- "ResponseMetadata": {
18533- "HTTPHeaders": {},
18534- "HTTPStatusCode": 200
18535- }
18536- }
18537- }
18538- },
1853918505 "tests/aws/services/s3/test_s3.py::TestS3::test_user_metadata_rfc2047_encoded": {
1854018506 "recorded-date": "30-01-2026, 19:37:24",
1854118507 "recorded-content": {
Original file line number Diff line number Diff line change 731731 "total" : 2.48
732732 }
733733 },
734- "tests/aws/services/s3/test_s3.py::TestS3::test_user_metadata_with_unicode" : {
735- "last_validated_date" : " 2026-01-30T18:32:27+00:00" ,
736- "durations_in_seconds" : {
737- "setup" : 1.03 ,
738- "call" : 0.33 ,
739- "teardown" : 0.96 ,
740- "total" : 2.32
741- }
742- },
743734 "tests/aws/services/s3/test_s3.py::TestS3BucketLifecycle::test_bucket_lifecycle_configuration_date" : {
744735 "last_validated_date" : " 2025-01-21T18:18:26+00:00"
745736 },
You can’t perform that action at this time.
0 commit comments