From eb9080ae282f0b9eabddd505b315123b3141ca42 Mon Sep 17 00:00:00 2001 From: atifcppprogrammer <54069350+atifcppprogrammer@users.noreply.github.com> Date: Sun, 31 Mar 2024 01:43:15 +0500 Subject: [PATCH] feat: added `tel`, `ftp` and `ftps` as safe URL protocols --- runtime.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime.go b/runtime.go index e22062c6e..8bda16774 100644 --- a/runtime.go +++ b/runtime.go @@ -470,7 +470,7 @@ const FailedSanitizationURL = SafeURL("about:invalid#TemplFailedSanitizationURL" func URL(s string) SafeURL { if i := strings.IndexRune(s, ':'); i >= 0 && !strings.ContainsRune(s[:i], '/') { protocol := s[:i] - if !strings.EqualFold(protocol, "http") && !strings.EqualFold(protocol, "https") && !strings.EqualFold(protocol, "mailto") { + if !strings.EqualFold(protocol, "http") && !strings.EqualFold(protocol, "https") && !strings.EqualFold(protocol, "mailto") && !strings.EqualFold(protocol, "tel") && !strings.EqualFold(protocol, "ftp") && !strings.EqualFold(protocol, "ftps") { return FailedSanitizationURL } }