1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-10-30 03:36:16 +00:00

Feeds: Assume HTTP when no protocol is set

This commit is contained in:
Timur Ismagilov 2022-02-03 23:52:56 +05:00
parent 36edcf6b77
commit 93783fa504

View File

@ -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
}