From 050f887398c262e2c0fd306b97609b5ab3561ed6 Mon Sep 17 00:00:00 2001 From: EpicKiwi Date: Fri, 15 Sep 2023 12:02:08 +0200 Subject: [PATCH] Only allow display registration on local machine --- loled.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/loled.js b/loled.js index 15a4a7b..76d6c4a 100755 --- a/loled.js +++ b/loled.js @@ -8,6 +8,12 @@ let display = null; router.get("/_loled/display/register", (ctx) => { + if(ctx.request.ip != "127.0.0.1"){ + ctx.response.status = 403 + ctx.response.body = "Only local machine is allowed to register a display" + return; + } + let name = ctx.request.url.searchParams.get("name"); if(!name){ name = "display-"+displayIndex