Fix incorrect API URL
This commit is contained in:
parent
2a34772457
commit
351b12131e
1 changed files with 5 additions and 1 deletions
|
@ -146,7 +146,11 @@ ## The Script
|
||||||
// https://api.ipify.org
|
// https://api.ipify.org
|
||||||
const publicIpUrl = "https://ipme.fosterhangdaan.com";
|
const publicIpUrl = "https://ipme.fosterhangdaan.com";
|
||||||
|
|
||||||
const goDaddyUrl = `https://api.godaddy.com/v1/domains/${domain}/records/A/@`;
|
const domainParts = domain.split(".");
|
||||||
|
const domainRoot = domainParts.slice(-2).join(".");
|
||||||
|
const domainName = domainParts.slice(0,-2).join(".") || "@";
|
||||||
|
|
||||||
|
const goDaddyUrl = `https://api.godaddy.com/v1/domains/${domainRoot}/records/A/${domainName}`;
|
||||||
|
|
||||||
const goDaddyRequestHeaders = new Headers({
|
const goDaddyRequestHeaders = new Headers({
|
||||||
Authorization: `sso-key ${GODADDY_API_KEY}:${GODADDY_API_SECRET}`,
|
Authorization: `sso-key ${GODADDY_API_KEY}:${GODADDY_API_SECRET}`,
|
||||||
|
|
Loading…
Reference in a new issue