file ext ignore case

This commit is contained in:
Meo597
2026-10-26 21:52:06 +08:00
parent 75c08917e3
commit 816f1d6123
3 changed files with 14 additions and 3 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ import (
"io"
"os"
"path/filepath"
"strings"
"github.com/xtls/xray-core/common/buf"
"github.com/xtls/xray-core/common/platform"
@@ -69,7 +70,7 @@ func ReadCert(file string) ([]byte, error) {
// ResolveLuaFile finds a local .lua script and returns its absolute path.
// Relative paths: XRAY_LOCATION_CONFDIR > XRAY_LOCATION_CONFIG > working dir > executable dir.
func ResolveLuaFile(path string) (string, error) {
if filepath.Ext(path) != ".lua" {
if !strings.EqualFold(filepath.Ext(path), ".lua") {
return "", errors.New("Lua file extension must be .lua")
}
if filepath.IsAbs(path) {