Fix incorrect addition of empty name in MockDomainList if the config string contains AlternativeNames=;

This commit is contained in:
notsure2 2021-07-22 20:05:30 +02:00
parent cfdff93a1c
commit 9d5c663618
1 changed files with 9 additions and 0 deletions

View File

@ -154,6 +154,15 @@ func (raw *RawConfig) ProcessRawConfig(worldState common.WorldState) (local Loca
return nullErr("ServerName")
}
auth.MockDomain = raw.ServerName
var filteredAlternativeNames []string
for _, alternativeName := range raw.AlternativeNames {
if len(alternativeName) > 0 {
filteredAlternativeNames = append(filteredAlternativeNames, alternativeName)
}
}
raw.AlternativeNames = filteredAlternativeNames
local.MockDomainList = raw.AlternativeNames
local.MockDomainList = append(local.MockDomainList, auth.MockDomain)
if raw.ProxyMethod == "" {