From d37c4144669e04ac31a1f5473875ed9db5c507d9 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 15 Jan 2024 23:15:54 +0000 Subject: [PATCH] validate the service host --- src/command/impl/addCommand.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/command/impl/addCommand.py b/src/command/impl/addCommand.py index 196bb2c..a00543d 100644 --- a/src/command/impl/addCommand.py +++ b/src/command/impl/addCommand.py @@ -18,6 +18,11 @@ class AddCommand(Command): if traefikConfig.hasRouter(name): print(f"Router \"{name}\" already exists") return + + # Validate if the service host is a valid URL + if not serviceHost.startswith("http://") and not serviceHost.startswith("https://"): + print(f"Service host \"{serviceHost}\" is not a valid URL") + return print(f"Adding \"{domain}\" -> \"{serviceHost}\"")