bug fix for allowFrom contains empty string

This commit is contained in:
Cytown
2026-04-13 23:34:44 +08:00
parent 7db2e7d579
commit 036f65b179
+10
View File
@@ -103,6 +103,16 @@ func NewBaseChannel(
allowList []string,
opts ...BaseChannelOption,
) *BaseChannel {
isEmpty := true
for _, s := range allowList {
if s != "" {
isEmpty = false
break
}
}
if isEmpty {
allowList = []string{}
}
bc := &BaseChannel{
config: config,
bus: bus,