From 7d1f6314bd3f724f280c173a8e1b56c3afb37b7a Mon Sep 17 00:00:00 2001 From: Michael Dayah Date: Wed, 16 Mar 2022 12:26:06 -0700 Subject: [PATCH] Works with service type "dyndns" Modified to work with the service type "dyndns." The variables %h and %i in the original instructions were never filled by UniFi 7.0.23. --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 0dcba58..f10e26d 100644 --- a/index.js +++ b/index.js @@ -24,7 +24,7 @@ async function handleRequest(request) { }, }); - case "/update": { + case "/nic/update": { if (request.headers.has("Authorization")) { const { username, password } = basicAuthentication(request); @@ -58,7 +58,7 @@ async function handleRequest(request) { async function informAPI(url, name, token) { // Parse Url const hostname = url.searchParams.get("hostname"); - const ip = url.searchParams.get("ip"); + const ip = url.searchParams.get("myip"); // Initialize API Handler const cloudflare = new Cloudflare({ @@ -93,7 +93,7 @@ function verifyParameters(url) { throw new BadRequestException("You must specify a hostname"); } - if (!url.searchParams.get("ip")) { + if (!url.searchParams.get("myip")) { throw new BadRequestException("You must specify an ip address"); } }