Skip to content

Commit

Permalink
check for empty key
Browse files Browse the repository at this point in the history
  • Loading branch information
dt3310321 committed Dec 15, 2017
1 parent 68605dd commit e4d6c35
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions qcloud_cos/cos_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ def uri(self, bucket, path=None, scheme=None, region=None):
if region is None:
region = self._region
if path is not None:
if path == "":
raise CosClientError("Key can't be empty string")
if path[0] == '/':
path = path[1:]
url = u"{scheme}://{bucket}.{region}.myqcloud.com/{path}".format(
Expand Down

0 comments on commit e4d6c35

Please sign in to comment.