fix: actually accept urls that kinda look like an url

This commit is contained in:
phga 2021-10-28 18:23:14 +02:00
parent 6af8b87dd4
commit 0aad1a95e5

View File

@ -76,8 +76,7 @@ func handleLinkList(w http.ResponseWriter, r *http.Request) {
url := r.PostForm.Get("url") url := r.PostForm.Get("url")
desc := r.PostForm.Get("description") desc := r.PostForm.Get("description")
if !strings.HasPrefix(url, "http://") || if !strings.HasPrefix(url, "http") {
!strings.HasPrefix(url, "https://") {
url = "https://" + url url = "https://" + url
} }