Skip to content

Commit 093910b

Browse files
committed
pass CNAME record directly instead of the whole records map
1 parent 102b2f2 commit 093910b

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

worker/domainVerification.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ async function verifyDomain (domain, models) {
107107
const recordMap = Object.fromEntries(records.map(record => [record.type, record]))
108108

109109
// verify the CNAME record
110-
const dnsVerified = await verifyDNS(domain, models, recordMap)
110+
const dnsVerified = await verifyRecord('CNAME', recordMap.CNAME, domain, models)
111111
if (!dnsVerified) return { status, message: 'DNS verification has failed.' }
112112

113113
// STEP 2: Request a certificate, get its validation values and check ACM validation
@@ -142,15 +142,6 @@ async function verifyDomain (domain, models) {
142142
return { status: 'ACTIVE', message: `Domain ${domain.domainName} has been successfully verified` }
143143
}
144144

145-
// verify the CNAME record
146-
async function verifyDNS (domain, models, records) {
147-
if (records.CNAME) {
148-
return await verifyRecord('CNAME', records.CNAME, domain, models)
149-
}
150-
151-
return false
152-
}
153-
154145
// verify a single record, logs the result and returns true if the record is valid
155146
async function verifyRecord (type, record, domain, models) {
156147
const result = await verifyDNSRecord(type, record.recordName, record.recordValue)

0 commit comments

Comments
 (0)