Parcourir la source

Clarify why TypeHost rejects ':' (IPv6 already returned above)

pull/480/head
Alexey Dolotov il y a 1 mois
Parent
révision
dfc805b67b
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3
    0
      internal/config/type_host.go

+ 3
- 0
internal/config/type_host.go Voir le fichier

28
 		return fmt.Errorf("incorrect host %q", value)
28
 		return fmt.Errorf("incorrect host %q", value)
29
 	}
29
 	}
30
 
30
 
31
+	// At this point value is not a parsed IP (IPv6 literals returned
32
+	// above), so any remaining colon indicates a host:port form, which
33
+	// belongs in a separate field.
31
 	if strings.Contains(value, ":") {
34
 	if strings.Contains(value, ":") {
32
 		return fmt.Errorf("host must not contain a port: %q", value)
35
 		return fmt.Errorf("host must not contain a port: %q", value)
33
 	}
36
 	}

Chargement…
Annuler
Enregistrer