From a97e1f50bf5838cd8dd71c3f3a0b25fd0989802a Mon Sep 17 00:00:00 2001 From: AI Engineer Date: Wed, 10 Jun 2026 09:45:42 +0800 Subject: [PATCH] refactor: use jsmod.Get for context configuration (by AI) --- file.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file.go b/file.go index 0845aca..2187ddc 100644 --- a/file.go +++ b/file.go @@ -308,9 +308,9 @@ func VerifyPathForSafeMode(ctx context.Context, path string) (string, error) { return RealPath(path), nil } - // 1. 获取白名单 (约定从 ctx 获取 "AllowedDirs") + // 1. 获取白名单 var allowedDirs []string - cast.Convert(&allowedDirs, ctx.Value("AllowedDirs")) + cast.Convert(&allowedDirs, jsmod.Get(ctx, "AllowedDirs")) if len(allowedDirs) == 0 { return "", fmt.Errorf("file: access denied, AllowedDirs not found in context") }