fix(output): fix wrong name of file

This commit is contained in:
2025-09-28 10:17:57 +01:00
parent 83d57eb877
commit 4a549cfea7

View File

@@ -10,8 +10,7 @@ import (
func GenerateOutputPaths(outputDir, upstream string, dnssec, keepAlive bool) (csvPath, pcapPath string) { func GenerateOutputPaths(outputDir, upstream string, dnssec, keepAlive bool) (csvPath, pcapPath string) {
proto := DetectProtocol(upstream) proto := DetectProtocol(upstream)
serverName := ExtractServerName(upstream) cleanServer := cleanServerName(upstream)
cleanServer := cleanServerName(serverName)
// Create date-based subdirectory // Create date-based subdirectory
date := time.Now().Format("2006-01-02") date := time.Now().Format("2006-01-02")
@@ -92,16 +91,3 @@ func DetectProtocol(upstream string) string {
} }
return "do53" return "do53"
} }
func ExtractServerName(upstream string) string {
if strings.Contains(upstream, "://") {
u, err := url.Parse(upstream)
if err == nil {
if u.Scheme == "https" && u.Path != "" && u.Path != "/" {
return u.Host + u.Path
}
return u.Host
}
}
return upstream
}