mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 04:47:48 +08:00
修改为正确执行resp.json()的条件
This commit is contained in:
@@ -82,7 +82,7 @@ class Module(object):
|
||||
if resp.status_code != 200 or not resp.content: # 状态码非200或者响应体为空
|
||||
logger.log('ALERT', f'GET {resp.url} {resp.status_code} - {resp.reason} {len(resp.content)}')
|
||||
content_type = resp.headers.get('Content-Type')
|
||||
if content_type and 'json' in content_type and not resp.content:
|
||||
if content_type and 'json' in content_type and resp.content:
|
||||
logger.log('ALERT', resp.json())
|
||||
return None
|
||||
logger.log('DEBUG', f'GET {resp.url} {resp.status_code} - {resp.reason} {len(resp.content)}')
|
||||
@@ -105,7 +105,7 @@ class Module(object):
|
||||
return None
|
||||
if resp.status_code != 200 or not resp.content: # 状态码非200或者响应体为空
|
||||
content_type = resp.headers.get('Content-Type')
|
||||
if content_type and 'json' in content_type and not resp.content:
|
||||
if content_type and 'json' in content_type and resp.content:
|
||||
logger.log('ALERT', resp.json())
|
||||
return None
|
||||
logger.log('DEBUG', f'POST {resp.url} {resp.status_code} - {resp.reason} {len(resp.content)}')
|
||||
|
||||
Reference in New Issue
Block a user