mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
bug fix for allowFrom contains empty string
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user