chore: fix typo

This commit is contained in:
Larvan2 2023-09-24 19:00:51 +08:00
parent 89d9cb0539
commit e6366f7442
3 changed files with 4 additions and 3 deletions

View file

@ -461,6 +461,7 @@ func UnmarshalRawConfig(buf []byte) (*RawConfig, error) {
GeoIp: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat",
GeoSite: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat",
},
ExternalUIURL: "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip",
}
if err := yaml.Unmarshal(buf, rawCfg); err != nil {

View file

@ -21,7 +21,7 @@ var (
ExternalUIName string
)
var (
ErrImcompleteConf = errors.New("ExternalUI configure incomplete")
ErrIncompleteConf = errors.New("ExternalUI configure incomplete")
)
var xdMutex sync.Mutex
@ -66,7 +66,7 @@ func UpdateUI() error {
func prepare() error {
if ExternalUIPath == "" || ExternalUIURL == "" {
return ErrImcompleteConf
return ErrIncompleteConf
}
if ExternalUIName != "" {

View file

@ -50,7 +50,7 @@ func upgradeCore(w http.ResponseWriter, r *http.Request) {
func updateUI(w http.ResponseWriter, r *http.Request) {
err := config.UpdateUI()
if err != nil {
if errors.Is(err, config.ErrImcompleteConf) {
if errors.Is(err, config.ErrIncompleteConf) {
log.Warnln("%s", err)
render.Status(r, http.StatusNotImplemented)
render.JSON(w, r, newError(fmt.Sprintf("%s", err)))