fix patch bug

This commit is contained in:
Kr328 committed 2020-03-28 14:39:28 +08:00
1 parent 1f9e330f6a
commit 9d5b8188eb
1 file changed
+6 -8
+6 -8
View File
@@ -2,10 +2,9 @@ package config
import (
"fmt"
"strings"
"github.com/Dreamacro/clash/component/fakeip"
"github.com/Dreamacro/clash/config"
"net/url"
)
var (
@@ -47,18 +46,17 @@ func patchRawConfig(rawConfig *config.RawConfig) {
providers := rawConfig.ProxyProvider
if len(rawConfig.ProxyProvider) == 0 {
providers = rawConfig.ProxyProviderOld
}
for _, provider := range providers {
path, ok := provider["path"].(string)
if !ok {
continue
}
path = strings.TrimSuffix(path, ".yaml")
path = strings.Replace(path, "/", "", -1)
path = strings.Replace(path, ".", "", -1)
path = "./" + path + ".yaml"
provider["path"] = path
provider["path"] = url.QueryEscape(path)
}
}