Autogen the Origin of the log and use it to replace the hardcoded ct.ipng.ch strings in gen-html and gen-env
This commit is contained in:
@@ -151,14 +151,10 @@ func extractPort(listenAddr string) string {
|
||||
}
|
||||
|
||||
func extractHostname(urlStr string) (string, error) {
|
||||
if !strings.HasPrefix(urlStr, "http://") && !strings.HasPrefix(urlStr, "https://") {
|
||||
urlStr = "https://" + urlStr
|
||||
}
|
||||
|
||||
parsedURL, err := url.Parse(urlStr)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return parsedURL.Hostname(), nil
|
||||
return parsedURL.Host, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user