From 21746c9a1e3950281c1d37092e5518f539f8c693 Mon Sep 17 00:00:00 2001 From: jingrow Date: Wed, 5 Nov 2025 00:15:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96whitelist.py=EF=BC=8C?= =?UTF-8?q?=E5=8F=AA=E5=A4=84=E7=90=86=E7=82=B9=E5=88=86=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jingrow/jingrow/services/whitelist.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/jingrow/jingrow/services/whitelist.py b/apps/jingrow/jingrow/services/whitelist.py index 8f23d89..6b0990e 100644 --- a/apps/jingrow/jingrow/services/whitelist.py +++ b/apps/jingrow/jingrow/services/whitelist.py @@ -113,7 +113,12 @@ async def _process_whitelist_call(request: Request, full_module_path: str): async def handle_request(request: Request, module_path: str): """ 直接传入完整点分路径 '' + 只处理包含点分路径的模块路径 """ + # 验证模块路径格式:必须包含至少一个点(如 package.module.function) + if '.' not in module_path: + raise HTTPException(status_code=404, detail="Not Found") + return await _process_whitelist_call(request, module_path) def import_module(module_path: str):