Skip to content

Commit e4d6c35

Browse files
committed
check for empty key
1 parent 68605dd commit e4d6c35

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

qcloud_cos/cos_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ def uri(self, bucket, path=None, scheme=None, region=None):
8585
if region is None:
8686
region = self._region
8787
if path is not None:
88+
if path == "":
89+
raise CosClientError("Key can't be empty string")
8890
if path[0] == '/':
8991
path = path[1:]
9092
url = u"{scheme}://{bucket}.{region}.myqcloud.com/{path}".format(

0 commit comments

Comments
 (0)