Ice3man543 2021-10-25 19:33:37 +05:30
parent bfaea5b89d
commit 09a2d88364
2 changed files with 10 additions and 10 deletions

View File

@ -209,10 +209,10 @@ func generateDNSVariables(domain string) map[string]interface{} {
domainName := strings.Join([]string{parsed.SLD, parsed.TLD}, ".")
return map[string]interface{}{
"{{FQDN}}": domain,
"{{RDN}}": domainName,
"{{DN}}": parsed.SLD,
"{{TLD}}": parsed.TLD,
"{{SD}}": parsed.TRD,
"FQDN": domain,
"RDN": domainName,
"DN": parsed.SLD,
"TLD": parsed.TLD,
"SD": parsed.TRD,
}
}

View File

@ -13,11 +13,11 @@ import (
func TestGenerateDNSVariables(t *testing.T) {
vars := generateDNSVariables("www.projectdiscovery.io")
require.Equal(t, map[string]interface{}{
"{{FQDN}}": "www.projectdiscovery.io",
"{{RDN}}": "projectdiscovery.io",
"{{DN}}": "projectdiscovery",
"{{TLD}}": "io",
"{{SD}}": "www",
"FQDN": "www.projectdiscovery.io",
"RDN": "projectdiscovery.io",
"DN": "projectdiscovery",
"TLD": "io",
"SD": "www",
}, vars, "could not get dns variables")
}