Skip to content

Commit 7acebea

Browse files
author
yikefan
committed
修复urllib3的写法,兼容高版本和低版本
1 parent 269c505 commit 7acebea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

volcenginesdkcore/rest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ def __init__(self, resp):
3535

3636
def getheaders(self):
3737
"""Returns a dictionary of the response headers."""
38-
return self.urllib3_response.getheaders()
38+
return self.urllib3_response.headers
3939

4040
def getheader(self, name, default=None):
4141
"""Returns a given response header."""
42-
return self.urllib3_response.getheader(name, default)
42+
return self.urllib3_response.headers.get(name, default)
4343

4444

4545
def log_request(method, url, query_params, headers, body, post_params, request_time_out):

0 commit comments

Comments
 (0)