Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions qcloud_cos/cos_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,13 @@ def get_auth(self, Method, Bucket, Key, Expired=300, Headers={}, Params={}, Sign
)
print (auth_string)
"""

# python中默认参数只会初始化一次,这里重新生成可变对象实例避免多线程访问问题
if not Headers:
Headers = dict()
if not Params:
Params = dict()

url = self._conf.uri(bucket=Bucket, path=Key)
r = Request(Method, url, headers=Headers, params=Params)
auth = CosS3Auth(self._conf, Key, Params, Expired, SignHost)
Expand Down
3 changes: 0 additions & 3 deletions ut/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
import os
import requests
import json

from requests.models import Response

import base64

from qcloud_cos import CosS3Client
Expand Down