From a9dd80310c4f1f8d4d9b73b068946fccf5c1d60d Mon Sep 17 00:00:00 2001 From: liamcottle Date: Thu, 30 May 2024 00:12:31 +1200 Subject: [PATCH] ensure name is not for an existing interface, to prevent overwriting --- web.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web.py b/web.py index 19864c4..e9840c9 100644 --- a/web.py +++ b/web.py @@ -257,6 +257,12 @@ class ReticulumWebChat: if "interfaces" in self.reticulum.config: interfaces = self.reticulum.config["interfaces"] + # ensure name is not for an existing interface, to prevent overwriting + if interface_name in interfaces: + return web.json_response({ + "message": "Name is already in use by another interface", + }, status=422) + # create interface details interface_details = { "type": interface_type,