This commit is contained in:
Meo597
2026-11-05 06:48:17 +08:00
parent d9da576f68
commit cc1355d7e9
+10 -1
View File
@@ -2,6 +2,7 @@ package conf
import (
"net/url"
"strings"
"github.com/robfig/cron/v3"
"github.com/xtls/xray-core/app/geodata"
@@ -19,11 +20,19 @@ func (c *GeodataAssetConfig) Build() (*geodata.Asset, error) {
return nil, errors.New("invalid geodata asset url: ", c.URL).Base(err)
}
return &geodata.Asset{
Url: c.URL,
Url: migrateGeodataURL(c.URL),
File: c.File,
}, nil
}
func migrateGeodataURL(assetURL string) string {
if strings.HasSuffix(assetURL, ".dat") && (strings.HasPrefix(strings.ToLower(assetURL), "https://raw.githubusercontent.com/xtls/xray-rules-dat/") || strings.HasPrefix(strings.ToLower(assetURL), "https://github.com/xtls/xray-rules-dat/")) {
errors.PrintDeprecatedFeatureWarning(assetURL, assetURL+".gz")
return assetURL + ".gz"
}
return assetURL
}
func validateHTTPS(s string) error {
u, err := url.ParseRequestURI(s)
if err != nil {