diff options
author | Jordan <me@jordan.im> | 2022-12-01 16:30:18 -0700 |
---|---|---|
committer | Jordan <me@jordan.im> | 2022-12-01 16:30:18 -0700 |
commit | a0f1cd2613f6483a375cb2ea4086f7ebb0212d64 (patch) | |
tree | 498c5fe9c9a8dbf281d51cad8ace7a70bad44347 | |
parent | d1e98508ecb9c8e3c547554118f53a1ba3be509a (diff) | |
download | keep-a0f1cd2613f6483a375cb2ea4086f7ebb0212d64.tar.gz keep-a0f1cd2613f6483a375cb2ea4086f7ebb0212d64.zip |
keep: ensure URLs have IA-supported schemes types
-rw-r--r-- | keep.go | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 } |