We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ac5f5c commit 2c3ca81Copy full SHA for 2c3ca81
1 file changed
iana/iana.go
@@ -24,15 +24,15 @@ func ExtractSuffix(name string) (string, error) {
24
25
suffix := rule.Decompose(name)[1]
26
27
- if !zlintutil.IsInTLDMap(suffix) {
28
- return "", fmt.Errorf("Domain %s has an unknown TLD %s", name, suffix)
29
- }
30
-
31
// If the TLD is empty, it means name is actually a suffix.
32
// In fact, decompose returns an array of empty strings in this case.
33
if suffix == "" {
34
suffix = name
35
}
36
+ if !zlintutil.IsInTLDMap(suffix) {
+ return "", fmt.Errorf("Domain %s has an unknown TLD %s", name, suffix)
+ }
+
37
return suffix, nil
38
0 commit comments