Browse Source

resolving PR comments

afeiszli 2 years ago
parent
commit
d3a35d00b9
2 changed files with 2 additions and 0 deletions
  1. 1 0
      models/structs.go
  2. 1 0
      servercfg/serverconf.go

+ 1 - 0
models/structs.go

@@ -262,6 +262,7 @@ type JoinData struct {
 	Key  string `json:"key" yaml:"key"`
 	Key  string `json:"key" yaml:"key"`
 }
 }
 
 
+// StunServer - struct to hold data required for using stun server
 type StunServer struct {
 type StunServer struct {
 	Domain string `json:"domain" yaml:"domain"`
 	Domain string `json:"domain" yaml:"domain"`
 	Port   int    `json:"port" yaml:"port"`
 	Port   int    `json:"port" yaml:"port"`

+ 1 - 0
servercfg/serverconf.go

@@ -645,6 +645,7 @@ func parseStunList(stunString string) ([]models.StunServer, error) {
 		return stunServers, errors.New("no stun servers provided")
 		return stunServers, errors.New("no stun servers provided")
 	}
 	}
 	for _, stun := range stuns {
 	for _, stun := range stuns {
+		stun = strings.Trim(stun, " ")
 		stunInfo := strings.Split(stun, ":")
 		stunInfo := strings.Split(stun, ":")
 		if len(stunInfo) != 2 {
 		if len(stunInfo) != 2 {
 			continue
 			continue