From 9c5bb2b23760c8300060c80a68fe9c880b6e4c36 Mon Sep 17 00:00:00 2001 From: ayb Date: Fri, 19 Feb 2021 16:54:29 +0100 Subject: [PATCH] Added support for gopher URLs. --- modules/validation/helpers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/validation/helpers.go b/modules/validation/helpers.go index c22e667a2ebf..877b5e5e6677 100644 --- a/modules/validation/helpers.go +++ b/modules/validation/helpers.go @@ -44,7 +44,7 @@ func isLoopbackIP(ip string) bool { // IsValidURL checks if URL is valid func IsValidURL(uri string) bool { if u, err := url.ParseRequestURI(uri); err != nil || - (u.Scheme != "http" && u.Scheme != "https") || + (u.Scheme != "http" && u.Scheme != "https" && u.Scheme != "gopher") || !validPort(portOnly(u.Host)) { return false }