refactor: use jsmod.Get for context configuration (by AI)
This commit is contained in:
parent
38e520c300
commit
63cd9d392a
@ -32,7 +32,7 @@ func init() {
|
|||||||
} else {
|
} else {
|
||||||
// 2. 远程数据库前缀校验
|
// 2. 远程数据库前缀校验
|
||||||
var allowedDSNs []string
|
var allowedDSNs []string
|
||||||
cast.Convert(&allowedDSNs, ctx.Value("AllowedDSNs"))
|
cast.Convert(&allowedDSNs, jsmod.Get(ctx, "AllowedDSNs"))
|
||||||
matched := false
|
matched := false
|
||||||
for _, prefix := range allowedDSNs {
|
for _, prefix := range allowedDSNs {
|
||||||
if strings.HasPrefix(name, prefix) {
|
if strings.HasPrefix(name, prefix) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user