Skip to content

Commit 5944262

Browse files
author
yuniszhang
committed
Merge branch 'master' of github.com:tencentyun/cos-python-sdk-v5
2 parents f8c53aa + 1c4efc9 commit 5944262

File tree

4 files changed

+477
-11
lines changed

4 files changed

+477
-11
lines changed

qcloud_cos/cos_auth.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ def __call__(self, r):
6969
# 判断headers中是否包含host头域
7070
contain_host = False
7171
for i in headers:
72-
if str.lower(i) == "host": # 兼容host/Host/HOST等
72+
if str.lower(i) == "host": # 兼容host/Host/HOST等
7373
contain_host = True
74-
break
74+
break
7575

7676
# 从url中提取host
7777
if not contain_host:
7878
url_parsed = urlparse(r.url)
7979
if url_parsed.hostname is not None:
80-
headers["host"] = url_parsed.hostname
80+
headers["host"] = url_parsed.hostname
8181

8282
# reserved keywords in headers urlencode are -_.~, notice that / should be encoded and space should not be encoded to plus sign(+)
8383
headers = dict([(quote(to_bytes(to_str(k)), '-_.~').lower(), quote(to_bytes(to_str(v)), '-_.~')) for k, v in

0 commit comments

Comments
 (0)