mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-27 13:37:09 +00:00
Platform: Consolidate regular file resolution
Reuse ResolveRegularFile for Lua loading/signing, local config, and assets. Only evaluate file symlinks when needed, tolerating junction-related resolution failures on a best-effort basis.
This commit is contained in:
@@ -61,15 +61,7 @@ func getAssetFileLocation(file string) (string, os.FileInfo, error) {
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
path := platform.GetAssetLocation(local)
|
||||
info, err := os.Stat(path)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
if !info.Mode().IsRegular() {
|
||||
return "", nil, errors.New("asset is not a regular file")
|
||||
}
|
||||
return path, info, nil
|
||||
return platform.ResolveRegularFile(platform.GetAssetLocation(local))
|
||||
}
|
||||
|
||||
func ReadCert(file string) ([]byte, error) {
|
||||
|
||||
Reference in New Issue
Block a user