mirror of
https://github.com/hotyue/IP-Sentinel.git
synced 2026-09-05 15:39:16 +08:00
fix(agent): 提拔 urllib 依赖至全局作用域,修复局部变量遮蔽导致的 Webhook 空回复崩溃 bug (v3.0.4-hotfix)
This commit is contained in:
@@ -65,6 +65,7 @@ import os
|
|||||||
import html
|
import html
|
||||||
# ================== [v3.0.4 新增密码学与解析依赖] ==================
|
# ================== [v3.0.4 新增密码学与解析依赖] ==================
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
import urllib.request # [修复] 提升至全局作用域,防止局部变量遮蔽
|
||||||
import hmac
|
import hmac
|
||||||
import hashlib
|
import hashlib
|
||||||
import time
|
import time
|
||||||
@@ -167,9 +168,7 @@ class AgentHandler(http.server.BaseHTTPRequestHandler):
|
|||||||
self.send_header("Content-type", "text/plain")
|
self.send_header("Content-type", "text/plain")
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
self.wfile.write(b"Action Accepted: fetch_log\n")
|
self.wfile.write(b"Action Accepted: fetch_log\n")
|
||||||
|
|
||||||
import urllib.request
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
config = {}
|
config = {}
|
||||||
if os.path.exists('/opt/ip_sentinel/config.conf'):
|
if os.path.exists('/opt/ip_sentinel/config.conf'):
|
||||||
|
|||||||
Reference in New Issue
Block a user