Skip to content

Commit

Permalink
Fix incorrect addition of empty name in MockDomainList if the config …
Browse files Browse the repository at this point in the history
…string contains AlternativeNames=;
  • Loading branch information
notsure2 committed Jul 22, 2021
1 parent cfdff93 commit 9d5c663
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 9d5c663

Please sign in to comment.