Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Works with service type "dyndns" #2

Merged
merged 1 commit into from
Mar 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function handleRequest(request) {
},
});

case "/update": {
case "/nic/update": {
if (request.headers.has("Authorization")) {
const { username, password } = basicAuthentication(request);

Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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");
}
}
Expand Down