mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-15 20:13:59 +00:00
lua: revert stdin check
This commit is contained in:
Vendored
+1
-1
@@ -30,7 +30,7 @@ func ConfigLoader(arg string) (out io.Reader, err error) {
|
||||
data, err = FetchHTTPContent(arg)
|
||||
|
||||
case arg == "stdin:":
|
||||
data, err = readConfigFile(os.Stdin)
|
||||
data, err = io.ReadAll(os.Stdin)
|
||||
|
||||
default:
|
||||
file, openErr := os.Open(arg)
|
||||
|
||||
+4
-1
@@ -52,7 +52,7 @@ func TestRunConfigCommands(t *testing.T) {
|
||||
{"merged source", []string{"run", "-test", "-format", "json", "-c", config, "-c", script}, 23, nil},
|
||||
{"dump", []string{"run", "-dump", "-c", config}, 0, nil},
|
||||
{"stdin pipe", []string{"run", "-test", "-c", "stdin:"}, 0, nil},
|
||||
{"stdin file", []string{"run", "-test", "-c", "stdin:"}, 23, file},
|
||||
{"stdin file", []string{"run", "-test", "-c", "stdin:"}, 0, file},
|
||||
{"convert json", []string{"convert", "json", message}, 0, nil},
|
||||
{"convert pb", []string{"convert", "pb", "-debug", config}, 0, nil},
|
||||
{"convert pb stdin", []string{"convert", "pb", "-debug", "stdin:"}, 0, file},
|
||||
@@ -65,6 +65,9 @@ func TestRunConfigCommands(t *testing.T) {
|
||||
cmd.Env = append(os.Environ(), "XRAY_TEST_CONFIG_COMMAND=1")
|
||||
cmd.Stdin = strings.NewReader("{}")
|
||||
if tc.input != nil {
|
||||
if _, err := file.Seek(0, io.SeekStart); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
cmd.Stdin = tc.input
|
||||
}
|
||||
output, err := cmd.CombinedOutput()
|
||||
|
||||
Reference in New Issue
Block a user