From 72100e483a763d4fa27ec544af29a41193ff5900 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Sat, 25 Dec 2021 12:56:44 +0000 Subject: [PATCH] Replace all non-alphanumeric symbols during hetzner creation --- lib/logic/api_maps/hetzner.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/logic/api_maps/hetzner.dart b/lib/logic/api_maps/hetzner.dart index 51833622..dc11d5aa 100644 --- a/lib/logic/api_maps/hetzner.dart +++ b/lib/logic/api_maps/hetzner.dart @@ -114,7 +114,8 @@ class HetznerApi extends ApiMap { final apiToken = StringGenerators.apiToken(); - final hostname = domainName.split('.')[0]; + // Replace all non-alphanumeric characters with an underscore + final hostname = domainName.split('.')[0].replaceAll(RegExp(r'[^a-zA-Z0-9]'), '_'); /// add ssh key when you need it: e.g. "ssh_keys":["kherel"] /// check the branch name, it could be "development" or "master".