Pārlūkot izejas kodu

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

pull/480/head
Alexey Dolotov 1 nedēļu atpakaļ
vecāks
revīzija
dfc805b67b
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 3
    0
      internal/config/type_host.go

+ 3
- 0
internal/config/type_host.go Parādīt failu

@@ -28,6 +28,9 @@ func (t *TypeHost) Set(value string) error {
28 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 34
 	if strings.Contains(value, ":") {
32 35
 		return fmt.Errorf("host must not contain a port: %q", value)
33 36
 	}

Notiek ielāde…
Atcelt
Saglabāt