mirror of
https://github.com/bestnite/sub2clash.git
synced 2025-07-04 20:02:34 +08:00
fix: 修复无法加载本地模板的问题
This commit is contained in:
@ -5,7 +5,6 @@ import (
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"net/url"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
@ -73,13 +72,13 @@ func ParseQuery(c *gin.Context) (SubValidator, error) {
|
||||
query.Proxies = nil
|
||||
}
|
||||
if query.Template != "" {
|
||||
uri, err := url.ParseRequestURI(query.Template)
|
||||
if err != nil {
|
||||
if strings.Contains(query.Template, string(os.PathSeparator)) {
|
||||
if strings.HasPrefix(query.Template, "http") {
|
||||
uri, err := url.ParseRequestURI(query.Template)
|
||||
if err != nil {
|
||||
return SubValidator{}, err
|
||||
}
|
||||
query.Template = uri.String()
|
||||
}
|
||||
query.Template = uri.String()
|
||||
}
|
||||
if query.RuleProvider != "" {
|
||||
reg := regexp.MustCompile(`\[(.*?)\]`)
|
||||
|
Reference in New Issue
Block a user