From 8db84a565629ec4ca43dada422af4af23482012d Mon Sep 17 00:00:00 2001 From: Lynnesbian Date: Tue, 10 Mar 2020 16:53:30 +1000 Subject: [PATCH] check to see whether site starts with http(s):// --- main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.py b/main.py index bcf52b1..918f734 100755 --- a/main.py +++ b/main.py @@ -35,6 +35,10 @@ try: except FileNotFoundError: open(args.cfg, "w").write("{}") +if not cfg['site'].startswith("https://") and not cfg['site'].startswith("http://"): + print("Site must begin with 'https://' or 'http://'. Value '{}' is invalid - try 'https://{}' instead.".format(cfg['site'])) + sys.exit(1) + print("Using {} as configuration file".format(args.cfg)) if "client" not in cfg: