From 9d2aa9fcd53304ce685fbb988d3abdbf0b2434f7 Mon Sep 17 00:00:00 2001 From: hotyue <52734432+hotyue@users.noreply.github.com> Date: Sat, 11 Apr 2026 02:23:52 +0000 Subject: [PATCH] =?UTF-8?q?fix(agent):=20=E6=8F=90=E6=8B=94=20urllib=20?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E8=87=B3=E5=85=A8=E5=B1=80=E4=BD=9C=E7=94=A8?= =?UTF-8?q?=E5=9F=9F=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=B1=80=E9=83=A8=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E9=81=AE=E8=94=BD=E5=AF=BC=E8=87=B4=E7=9A=84=20Webhoo?= =?UTF-8?q?k=20=E7=A9=BA=E5=9B=9E=E5=A4=8D=E5=B4=A9=E6=BA=83=20bug=20(v3.0?= =?UTF-8?q?.4-hotfix)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/agent_daemon.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/agent_daemon.sh b/core/agent_daemon.sh index d1a7c9d..0b7c2b4 100755 --- a/core/agent_daemon.sh +++ b/core/agent_daemon.sh @@ -65,6 +65,7 @@ import os import html # ================== [v3.0.4 新增密码学与解析依赖] ================== import urllib.parse +import urllib.request # [修复] 提升至全局作用域,防止局部变量遮蔽 import hmac import hashlib import time @@ -167,9 +168,7 @@ class AgentHandler(http.server.BaseHTTPRequestHandler): self.send_header("Content-type", "text/plain") self.end_headers() self.wfile.write(b"Action Accepted: fetch_log\n") - - import urllib.request - + try: config = {} if os.path.exists('/opt/ip_sentinel/config.conf'):