Skip to content

Commit

Permalink
Merge pull request #168 from notsure2/fix-empty-alternative-names
Browse files Browse the repository at this point in the history
Fix incorrect addition of empty name in MockDomainList if the config string contains AlternativeNames=;
  • Loading branch information
cbeuw authored Jul 24, 2021
2 parents d73f464 + 9d5c663 commit 121c27f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/client/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand Down

0 comments on commit 121c27f

Please sign in to comment.