🐛 Fix Error when template name contains "http"

This commit is contained in:
2024-05-09 14:12:55 +08:00
parent 3030ec5259
commit 9575fcf925
3 changed files with 7 additions and 13 deletions

View File

@@ -161,7 +161,11 @@ func AddCountryGroup(proxies []model.Outbound, groupType string, sortKey string,
func MergeTemplate(outbounds []model.Outbound, template string) (string, error) {
var config model.Config
var err error
if strings.HasPrefix(template, "http") {
isNetworkFile, err := regexp.MatchString(`^https?://`, template)
if err != nil {
return "", err
}
if isNetworkFile {
data, err := util.Fetch(template, 3)
if err != nil {
return "", err