From 0682ebb55e4394177b6c55ad10345e93d29013ba Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 7 Jun 2022 14:00:59 +0800 Subject: [PATCH] bugfix --- appPublic/ExecFile.py | 2 +- appPublic/http_client.py | 8 ++++++++ appPublic/rc4.py | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/appPublic/ExecFile.py b/appPublic/ExecFile.py index 3346813..ae64638 100644 --- a/appPublic/ExecFile.py +++ b/appPublic/ExecFile.py @@ -100,7 +100,7 @@ class ExecFile(object) : try : exec(buf,globals(),self.__object.__dict__) except Exception as e: - print("ExecFile()",e) + print("ExecFile()",e,self.__file) return (False,e) return (True,'') diff --git a/appPublic/http_client.py b/appPublic/http_client.py index 357e0fc..0fcef1e 100644 --- a/appPublic/http_client.py +++ b/appPublic/http_client.py @@ -24,6 +24,13 @@ class Http_Client: def __init__(self): self.s = requests.Session() self.s.verify = False + self.s.hooks['response'].append(self.response_handler) + + def prepped_handler(self, prepped): + pass + + def response_handler(self, resp, *args, **kw): + return resp def url2domain(self,url): parts = url.split('/')[:3] @@ -47,6 +54,7 @@ class Http_Client: req = requests.Request(method,url, data=params,files=files,headers=headers) prepped = self.s.prepare_request(req) + self.prepped_handler(prepped) resp = self.s.send(prepped) if resp.status_code == 200: h = resp.headers.get('Set-Cookie',None) diff --git a/appPublic/rc4.py b/appPublic/rc4.py index d6a0fde..86ca3b6 100644 --- a/appPublic/rc4.py +++ b/appPublic/rc4.py @@ -89,7 +89,7 @@ class KeyChain(object): i = self.get_indicator(ts) if i + self.threshold > ts: return True - return FalseTrue + return False def is_near_top(self, indicator=None): ts = self.get_timestamp()