From 0aad1a95e51671797457868ad58f5ea3b9b2dbf6 Mon Sep 17 00:00:00 2001 From: phga Date: Thu, 28 Oct 2021 18:23:14 +0200 Subject: [PATCH] fix: actually accept urls that kinda look like an url --- cmd/bs1in/bs1in.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/bs1in/bs1in.go b/cmd/bs1in/bs1in.go index 1555169..5ac4b47 100644 --- a/cmd/bs1in/bs1in.go +++ b/cmd/bs1in/bs1in.go @@ -76,8 +76,7 @@ func handleLinkList(w http.ResponseWriter, r *http.Request) { url := r.PostForm.Get("url") desc := r.PostForm.Get("description") - if !strings.HasPrefix(url, "http://") || - !strings.HasPrefix(url, "https://") { + if !strings.HasPrefix(url, "http") { url = "https://" + url }