Skip to content

Commit

Permalink
增加ci内容审核相关的接口。 (#173)
Browse files Browse the repository at this point in the history
* ci auditing interface add

* modify params

* analyze

Co-authored-by: root <[email protected]>
Co-authored-by: degangliu <[email protected]>
  • Loading branch information
3 people authored Sep 16, 2021
1 parent 20d9e94 commit a336377
Show file tree
Hide file tree
Showing 4 changed files with 477 additions and 11 deletions.
6 changes: 3 additions & 3 deletions qcloud_cos/cos_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ def __call__(self, r):
# 判断headers中是否包含host头域
contain_host = False
for i in headers:
if str.lower(i) == "host": # 兼容host/Host/HOST等
if str.lower(i) == "host": # 兼容host/Host/HOST等
contain_host = True
break
break

# 从url中提取host
if not contain_host:
url_parsed = urlparse(r.url)
if url_parsed.hostname is not None:
headers["host"] = url_parsed.hostname
headers["host"] = url_parsed.hostname

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

0 comments on commit a336377

Please sign in to comment.