From a0f1cd2613f6483a375cb2ea4086f7ebb0212d64 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 1 Dec 2022 16:30:18 -0700 Subject: keep: ensure URLs have IA-supported schemes types --- keep.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/keep.go b/keep.go index 75b0fcb..1305779 100644 --- a/keep.go +++ b/keep.go @@ -180,7 +180,9 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { // Assess whether message part looks like a valid URL u, err := url.Parse(w) - if err != nil || !u.IsAbs() || strings.IndexByte(u.Host, '.') <= 0 { + if err != nil || !u.IsAbs() || strings.IndexByte(u.Host, '.') <= 0 || + (u.Scheme != "https" && u.Scheme != "http") { + continue } -- cgit v1.2.3-54-g00ecf