fix patch bug
This commit is contained in:
1 file changed
+6
-8
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user