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

View file

@ -103,6 +103,16 @@ func NewBaseChannel(
allowList []string, allowList []string,
opts ...BaseChannelOption, opts ...BaseChannelOption,
) *BaseChannel { ) *BaseChannel {
isEmpty := true
for _, s := range allowList {
if s != "" {
isEmpty = false
break
}
}
if isEmpty {
allowList = []string{}
}
bc := &BaseChannel{ bc := &BaseChannel{
config: config, config: config,
bus: bus, bus: bus,