mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-05-11 18:36:11 +02:00
remove end slash when setting server config (#8779)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
parent
22f3425ace
commit
14b505130b
1 changed files with 10 additions and 3 deletions
|
@ -3098,9 +3098,16 @@ Future<bool> setServerConfig(
|
||||||
List<RxString>? errMsgs,
|
List<RxString>? errMsgs,
|
||||||
ServerConfig config,
|
ServerConfig config,
|
||||||
) async {
|
) async {
|
||||||
config.idServer = config.idServer.trim();
|
String removeEndSlash(String input) {
|
||||||
config.relayServer = config.relayServer.trim();
|
if (input.endsWith('/')) {
|
||||||
config.apiServer = config.apiServer.trim();
|
return input.substring(0, input.length - 1);
|
||||||
|
}
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
config.idServer = removeEndSlash(config.idServer.trim());
|
||||||
|
config.relayServer = removeEndSlash(config.relayServer.trim());
|
||||||
|
config.apiServer = removeEndSlash(config.apiServer.trim());
|
||||||
config.key = config.key.trim();
|
config.key = config.key.trim();
|
||||||
if (controllers != null) {
|
if (controllers != null) {
|
||||||
controllers[0].text = config.idServer;
|
controllers[0].text = config.idServer;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue