S3: fixed tagging (#6491)

This commit is contained in:
Macwan Nevil 2023-07-14 18:24:41 +05:30 committed by GitHub
parent 1098d4557f
commit 55a72f3e88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -1923,7 +1923,7 @@ class S3Response(BaseResponse):
tags = {}
for tag in parsed_xml["Tagging"]["TagSet"]["Tag"]:
tags[tag["Key"]] = tag["Value"]
tags[tag["Key"]] = tag["Value"] or ""
return tags

View File

@ -69,6 +69,7 @@ def test_put_bucket_tagging():
"TagSet": [
{"Key": "TagOne", "Value": "ValueOne"},
{"Key": "TagTwo", "Value": "ValueTwo"},
{"Key": "TagThree", "Value": ""},
]
},
)
@ -222,6 +223,7 @@ def test_put_object_tagging():
"TagSet": [
{"Key": "item1", "Value": "foo"},
{"Key": "item2", "Value": "bar"},
{"Key": "item3", "Value": ""},
]
},
)