Skip to content

Commit

Permalink
Restrict protocol of "server_url" values to HTTP(S)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Nov 6, 2017
1 parent da9f297 commit 0d93321
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server.py
Expand Up @@ -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",
Expand Down

0 comments on commit 0d93321

Please sign in to comment.