|
|
|
@ -9,11 +9,13 @@ func CompleteUrlHttp(url string) string {
|
|
|
|
|
if url == "" {
|
|
|
|
|
return url
|
|
|
|
|
}
|
|
|
|
|
if strings.HasPrefix(url, "http://") {
|
|
|
|
|
return url
|
|
|
|
|
}
|
|
|
|
|
if strings.HasPrefix(url, "//") {
|
|
|
|
|
url = "http:" + url
|
|
|
|
|
} else if strings.HasPrefix(url, "://") {
|
|
|
|
|
url = "http" + url
|
|
|
|
|
} else if strings.HasPrefix(url, "http://") {
|
|
|
|
|
} else if strings.HasPrefix(url, "https://") {
|
|
|
|
|
url = Replace(url, "https://", "http://")
|
|
|
|
|
} else {
|
|
|
|
@ -27,13 +29,15 @@ func CompleteUrlHttps(url string) string {
|
|
|
|
|
if url == "" {
|
|
|
|
|
return url
|
|
|
|
|
}
|
|
|
|
|
if strings.HasPrefix(url, "https://") {
|
|
|
|
|
return url
|
|
|
|
|
}
|
|
|
|
|
if strings.HasPrefix(url, "//") {
|
|
|
|
|
url = "https:" + url
|
|
|
|
|
} else if strings.HasPrefix(url, "://") {
|
|
|
|
|
url = "https" + url
|
|
|
|
|
} else if strings.HasPrefix(url, "http://") {
|
|
|
|
|
url = Replace(url, "http://", "https://")
|
|
|
|
|
} else if strings.HasPrefix(url, "https://") {
|
|
|
|
|
} else {
|
|
|
|
|
url = "https://" + url
|
|
|
|
|
}
|
|
|
|
|