提交 88c5a4be 编写于 作者: H HexToString

fix bug

上级 af8a54ea
...@@ -457,8 +457,8 @@ class GeneralClient(object): ...@@ -457,8 +457,8 @@ class GeneralClient(object):
# 当数据区长度大于512字节时才压缩. # 当数据区长度大于512字节时才压缩.
try: try:
if self.try_request_gzip and self.total_data_number > 512: if self.try_request_gzip and self.total_data_number > 512:
origin_data = postData
if http_proto: if self.http_proto:
postData = gzip.compress(postData) postData = gzip.compress(postData)
else: else:
postData = gzip.compress(bytes(postData, 'utf-8')) postData = gzip.compress(bytes(postData, 'utf-8'))
...@@ -469,7 +469,6 @@ class GeneralClient(object): ...@@ -469,7 +469,6 @@ class GeneralClient(object):
except: except:
print("compress error, we will use the no-compress data") print("compress error, we will use the no-compress data")
headers.pop("Content-Encoding", "nokey") headers.pop("Content-Encoding", "nokey")
postData = origin_data
# requests支持自动识别解压 # requests支持自动识别解压
try: try:
result = self.requests_session.post( result = self.requests_session.post(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册