fix(output): fix wrong name of file
This commit is contained in:
@@ -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
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user