mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-01-22 10:38:14 -05:00
fix: 修复节点密钥包含特殊字符时校验失败的问题
This commit is contained in:
parent
0c2360972b
commit
2eb81924e4
@ -24,7 +24,14 @@ class Server
|
|||||||
'hysteria2' => 'hysteria'
|
'hysteria2' => 'hysteria'
|
||||||
];
|
];
|
||||||
$request->validate([
|
$request->validate([
|
||||||
'token' => ['required', 'string', 'in:' . admin_setting('server_token')],
|
'token' => [
|
||||||
|
"string",
|
||||||
|
function ($attribute, $value, $fail) {
|
||||||
|
if ($value !== admin_setting('server_token')) {
|
||||||
|
$fail('The ' . $attribute . ' is invalid.');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
],
|
||||||
'node_id' => 'required',
|
'node_id' => 'required',
|
||||||
'node_type' => [
|
'node_type' => [
|
||||||
'nullable',
|
'nullable',
|
||||||
@ -34,7 +41,6 @@ class Server
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
], [
|
], [
|
||||||
'token.in' => 'Token is error!',
|
|
||||||
'node_type.regex' => 'node_type is error!'
|
'node_type.regex' => 'node_type is error!'
|
||||||
]);
|
]);
|
||||||
$nodeInfo = ServerService::getServer($request->input('node_id'), $request->input('node_type') ?? $node_type);
|
$nodeInfo = ServerService::getServer($request->input('node_id'), $request->input('node_type') ?? $node_type);
|
||||||
|
Loading…
Reference in New Issue
Block a user