Merge pull request #2507 from cytown/allow
bug fix for allowFrom contains empty string
This commit is contained in:
commit
aa1d7c55be
1 changed files with 10 additions and 0 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue