From 0d93321f6d9dbca93b34a7519bf6cdd6e53c6da0 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Mon, 6 Nov 2017 19:45:28 +0100 Subject: [PATCH] Restrict protocol of "server_url" values to HTTP(S) --- server.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server.py b/server.py index 4563e12..0913f4a 100755 --- a/server.py +++ b/server.py @@ -110,6 +110,11 @@ def announce(): server["clients_top"] = max(server["clients"], old["clients_top"]) if old else server["clients"] + if "url" in server: + url = server["url"] + if not any(url.startswith(p) for p in ["http://", "https://", "//"]): + del server["url"] + # Make sure that startup options are saved if action == "update": for field in ("dedicated", "rollback", "mapgen", "privs",