s3 key_name encoding should be variable (#5184)
This commit is contained in:
parent
34a98d2c20
commit
b96eafb3c3
@ -154,9 +154,10 @@ class FakeKey(BaseModel):
|
||||
|
||||
self.s3_backend = s3_backend
|
||||
|
||||
@property
|
||||
def safe_name(self):
|
||||
return urllib.parse.quote(self.name, safe="")
|
||||
def safe_name(self, encoding_type=None):
|
||||
if encoding_type == "url":
|
||||
return urllib.parse.quote(self.name, safe="")
|
||||
return self.name
|
||||
|
||||
@property
|
||||
def version_id(self):
|
||||
|
@ -2064,7 +2064,7 @@ S3_BUCKET_GET_RESPONSE = """<?xml version="1.0" encoding="UTF-8"?>
|
||||
{% endif %}
|
||||
{% for key in result_keys %}
|
||||
<Contents>
|
||||
<Key>{{ key.safe_name }}</Key>
|
||||
<Key>{{ key.safe_name(encoding_type) }}</Key>
|
||||
<LastModified>{{ key.last_modified_ISO8601 }}</LastModified>
|
||||
<ETag>{{ key.etag }}</ETag>
|
||||
<Size>{{ key.size }}</Size>
|
||||
@ -2107,7 +2107,7 @@ S3_BUCKET_GET_RESPONSE_V2 = """<?xml version="1.0" encoding="UTF-8"?>
|
||||
{% endif %}
|
||||
{% for key in result_keys %}
|
||||
<Contents>
|
||||
<Key>{{ key.safe_name }}</Key>
|
||||
<Key>{{ key.safe_name(encoding_type) }}</Key>
|
||||
<LastModified>{{ key.last_modified_ISO8601 }}</LastModified>
|
||||
<ETag>{{ key.etag }}</ETag>
|
||||
<Size>{{ key.size }}</Size>
|
||||
|
Loading…
Reference in New Issue
Block a user