S3 - avoid encoding of / (#5261)
This commit is contained in:
parent
7d8c05ebee
commit
20a2218ddc
@ -163,7 +163,7 @@ class FakeKey(BaseModel, ManagedState):
|
|||||||
|
|
||||||
def safe_name(self, encoding_type=None):
|
def safe_name(self, encoding_type=None):
|
||||||
if encoding_type == "url":
|
if encoding_type == "url":
|
||||||
return urllib.parse.quote(self.name, safe="")
|
return urllib.parse.quote(self.name)
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -152,6 +152,14 @@ def test_key_name_encoding_in_listing():
|
|||||||
key_received = client.list_objects_v2(Bucket="foobar")["Contents"][0]["Key"]
|
key_received = client.list_objects_v2(Bucket="foobar")["Contents"][0]["Key"]
|
||||||
key_received.should.equal(name)
|
key_received.should.equal(name)
|
||||||
|
|
||||||
|
name = "example/file.text"
|
||||||
|
client.put_object(Bucket="foobar", Key=name, Body=b"")
|
||||||
|
|
||||||
|
key_received = client.list_objects(
|
||||||
|
Bucket="foobar", Prefix="example/", Delimiter="/", MaxKeys=1, EncodingType="url"
|
||||||
|
)["Contents"][0]["Key"]
|
||||||
|
key_received.should.equal(name)
|
||||||
|
|
||||||
|
|
||||||
@mock_s3
|
@mock_s3
|
||||||
def test_empty_key_set_on_existing_key():
|
def test_empty_key_set_on_existing_key():
|
||||||
|
Loading…
Reference in New Issue
Block a user