diff --git a/.github/workflows/auto-test.yml b/.github/workflows/auto-test.yml index dbeea30c4..7186e01aa 100644 --- a/.github/workflows/auto-test.yml +++ b/.github/workflows/auto-test.yml @@ -1,5 +1,9 @@ name: Auto Test +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-server + cancel-in-progress: true + on: push: branches: [master, 1.23.X, 3.0.0] diff --git a/server/analytics/plausible-analytics.js b/server/analytics/plausible-analytics.js index a043c2464..015f63331 100644 --- a/server/analytics/plausible-analytics.js +++ b/server/analytics/plausible-analytics.js @@ -5,7 +5,7 @@ const { escape } = require("html-escaper"); * Returns a string that represents the javascript that is required to insert the Plausible Analytics script * into a webpage. * @param {string} scriptUrl the Plausible Analytics script url. - * @param {string} domainsToMonitor Domains to track seperated by a ',' to add Plausible Analytics script. + * @param {string} domainsToMonitor Domains to track separated by a ',' to add Plausible Analytics script. * @returns {string} HTML script tags to inject into page */ function getPlausibleAnalyticsScript(scriptUrl, domainsToMonitor) { diff --git a/server/model/domain_expiry.js b/server/model/domain_expiry.js index 3502a4b08..6d91b5d63 100644 --- a/server/model/domain_expiry.js +++ b/server/model/domain_expiry.js @@ -30,10 +30,13 @@ async function getRdapServer(tld) { return null; } - for (const service of rdapList["services"]) { - const [tlds, urls] = service; - if (tlds.includes(tld)) { - return urls[0]; + const services = rdapList["services"] ?? []; + const rootTld = tld?.split(".").pop(); + if (rootTld) { + for (const [tlds, urls] of services) { + if (tlds.includes(rootTld)) { + return urls[0]; + } } } log.debug("rdap", `No RDAP server found for TLD ${tld}`); @@ -173,16 +176,18 @@ class DomainExpiry extends BeanModel { }); } - const rdap = await getRdapServer(tld.publicSuffix); + const publicSuffix = tld.publicSuffix; + const rootTld = publicSuffix.split(".").pop(); + const rdap = await getRdapServer(publicSuffix); if (!rdap) { throw new TranslatableError("domain_expiry_unsupported_unsupported_tld_no_rdap_endpoint", { - publicSuffix: tld.publicSuffix, + publicSuffix, }); } return { domain: tld.domain, - tld: tld.publicSuffix, + tld: rootTld, }; } diff --git a/src/components/MonitorList.vue b/src/components/MonitorList.vue index e10580463..28e83a8cc 100644 --- a/src/components/MonitorList.vue +++ b/src/components/MonitorList.vue @@ -1,5 +1,5 @@