fix: external-ui-name must in local

This commit is contained in:
wwqgtxx committed 2025-05-19 23:11:52 +08:00
1 parent d036d98128
commit 608ddb1b44
1 file changed
+4
+4
View File
@@ -7,6 +7,7 @@ import (
"net"
"net/netip"
"net/url"
"path/filepath"
"strings"
"time"
_ "unsafe"
@@ -759,6 +760,9 @@ func parseController(cfg *RawConfig) (*Controller, error) {
if path := cfg.ExternalUI; path != "" && !C.Path.IsSafePath(path) {
return nil, C.Path.ErrNotSafePath(path)
}
if uiName := cfg.ExternalUIName; uiName != "" && !filepath.IsLocal(uiName) {
return nil, fmt.Errorf("external UI name is not local: %s", uiName)
}
return &Controller{
ExternalController: cfg.ExternalController,
ExternalUI: cfg.ExternalUI,