From 93783fa504209a78c33ba8244ba252915879f797 Mon Sep 17 00:00:00 2001 From: Timur Ismagilov Date: Thu, 3 Feb 2022 23:52:56 +0500 Subject: [PATCH] Feeds: Assume HTTP when no protocol is set --- cfg/config.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cfg/config.go b/cfg/config.go index 9aef87d..52d8122 100644 --- a/cfg/config.go +++ b/cfg/config.go @@ -7,6 +7,7 @@ import ( "errors" "fmt" "os" + "strings" "github.com/go-ini/ini" ) @@ -186,8 +187,8 @@ func ReadConfigFile(path string) error { TelegramBotName = cfg.TelegramBotName TelegramEnabled = (TelegramBotToken != "") && (TelegramBotName != "") - // This URL makes much more sense. - if URL == "" { + // This URL makes much more sense. If no URL is set or the protocol is forgotten, assume HTTP. + if (URL == "") || (strings.Index(URL, ":") == -1) { URL = "http://" + ListenAddr }